forked from NOAA-PSL/stochastic_physics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstochy_internal_state_mod.F90
140 lines (108 loc) · 5.25 KB
/
stochy_internal_state_mod.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
!>@brief The module 'stochy_internal_state_mod' contains the spherical harmonic definitions and arrays
!! describing the target gaussian grid
!
! !module: stochy_internal_state_mod
! --- internal state definition of the
! gridded component of the spectral random patterns
!
! !description: define the spectral internal state used to
! create the internal state.
!---------------------------------------------------------------------------
! !revision history:
!
! Oct 11 2016 P Pegion port of gfs_dynamics_interal_state
!
! !interface:
!
module stochy_internal_state_mod
!!uses:
!------
use spectral_layout_mod
use stochy_gg_def
use stochy_resol_def
implicit none
private
! -----------------------------------------------
!>@brief Derived type 'stochy_internal_state' contains all of the spherical harmonic and gaussian grid information
!>@details This code is taken from the legacy spectral GFS
type,public::stochy_internal_state ! start type define
! -----------------------------------------------
! DH* todo remove - is in spectral_layout?
integer :: me, nodes
integer :: lnt2_s, llgg_s
integer :: lnt2
integer :: grib_inp
!
integer nxpt,nypt,jintmx
integer lonf,latg,lats_node_a_max
integer npe_single_member
character(16) :: cfhour1
!jws
integer :: num_file
character(32) ,allocatable :: filename_base(:)
integer :: ipt_lats_node_a
integer :: lats_node_a
!jwe
integer :: nblck,kdt
! real :: deltim
integer ,allocatable :: lonsperlat (:)
integer ,allocatable :: ls_node (:)
integer ,allocatable :: ls_nodes (:, :)
integer ,allocatable :: max_ls_nodes (:)
integer ,allocatable :: lats_nodes_a (:)
integer ,allocatable :: global_lats_a (:)
integer ,allocatable :: lats_nodes_ext (:)
integer ,allocatable :: global_lats_ext(:)
integer ,allocatable :: global_lats_h (:)
integer :: xhalo,yhalo
integer ,allocatable :: lats_nodes_a_fix (:)
real(kind=kind_dbl_prec) ,allocatable :: epse (:)
real(kind=kind_dbl_prec) ,allocatable :: epso (:)
real(kind=kind_dbl_prec) ,allocatable :: epsedn(:)
real(kind=kind_dbl_prec) ,allocatable :: epsodn(:)
real(kind=kind_dbl_prec) ,allocatable :: kenorm_e(:)
real(kind=kind_dbl_prec) ,allocatable :: kenorm_o(:)
real(kind=kind_dbl_prec) ,allocatable :: snnp1ev(:)
real(kind=kind_dbl_prec) ,allocatable :: snnp1od(:)
real(kind=kind_dbl_prec) ,allocatable :: plnev_a(:,:)
real(kind=kind_dbl_prec) ,allocatable :: plnod_a(:,:)
real(kind=kind_dbl_prec) ,allocatable :: pddev_a(:,:)
real(kind=kind_dbl_prec) ,allocatable :: pddod_a(:,:)
real(kind=kind_dbl_prec) ,allocatable :: plnew_a(:,:)
real(kind=kind_dbl_prec) ,allocatable :: plnow_a(:,:)
real(kind=kind_dbl_prec) ,allocatable :: trie_ls(:,:,:)
real(kind=kind_dbl_prec) ,allocatable :: trio_ls(:,:,:)
INTEGER :: TRIEO_TOTAL_SIZE
INTEGER, ALLOCATABLE, DIMENSION(:) :: TRIE_LS_SIZE
INTEGER, ALLOCATABLE, DIMENSION(:) :: TRIO_LS_SIZE
INTEGER, ALLOCATABLE, DIMENSION(:) :: TRIEO_LS_SIZE
INTEGER, ALLOCATABLE, DIMENSION(:) :: LS_MAX_NODE_GLOBAL
INTEGER, ALLOCATABLE, DIMENSION(:, :) :: LS_NODE_GLOBAL
!
!!
integer init,jcount,jpt,node,ibmsign,lon_dim,ilat
real(kind=kind_dbl_prec) colat1, rone, rlons_lat, scale_ibm
integer lotls,lotgr,lots,lots_slg,lotd,lota,lotp
integer ibrad,ifges,ihour,ini,j,jdt,ksout,maxstp
integer mdt,idt,timetot,timer,time0
integer mods,n1,n2,ndgf,ndgi,nfiles,nflps
integer n1hyb, n2hyb,nlunit
integer nges,ngpken,niter,nnmod,nradf,nradr
integer nsfcf,nsfci,nsfcs,nsigi,nsigs,nstep
integer nznlf,nznli,nznls,id,iret,nsout,ndfi
integer ierr,iprint,k,l,locl,n
integer lan,lat
integer spectral_loop
integer ikey,nrank_all,kcolor
real(kind=kind_dbl_prec) cons0p5,cons1200,cons3600,cons0
!
! -----------------------------------------------------
end type stochy_internal_state ! end type define
! -----------------------------------------------------
! this state is supported by c pointer not f90 pointer, thus
! need this wrap.
!-----------------------------------------------------------
type stochy_wrap ! begin type define
type (stochy_internal_state), pointer :: int_state
end type stochy_wrap ! end type define
end module stochy_internal_state_mod