1 | MODULE usrdef_istate |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE usrdef_istate *** |
---|
4 | !! |
---|
5 | !! === WAD_TEST_CASES configuration === |
---|
6 | !! |
---|
7 | !! User defined : set the initial state of a user configuration |
---|
8 | !!====================================================================== |
---|
9 | !! History : NEMO ! 2016-03 (S. Flavoni, G. Madec) Original code |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! usr_def_istate : initial state in Temperature and salinity |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | USE par_oce ! ocean space and time domain |
---|
16 | USE dom_oce , ONLY : mi0, mig, mjg, glamt, gphit, ht_0 |
---|
17 | USE phycst ! physical constants |
---|
18 | USE wet_dry ! Wetting and drying |
---|
19 | ! |
---|
20 | USE in_out_manager ! I/O manager |
---|
21 | USE lib_mpp ! MPP library |
---|
22 | |
---|
23 | IMPLICIT NONE |
---|
24 | PRIVATE |
---|
25 | |
---|
26 | PUBLIC usr_def_istate ! called by istate.F90 |
---|
27 | |
---|
28 | !!---------------------------------------------------------------------- |
---|
29 | !! NEMO/OPA 4.0 , NEMO Consortium (2016) |
---|
30 | !! $Id$ |
---|
31 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
32 | !!---------------------------------------------------------------------- |
---|
33 | CONTAINS |
---|
34 | |
---|
35 | SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv, pssh ) |
---|
36 | !!---------------------------------------------------------------------- |
---|
37 | !! *** ROUTINE usr_def_istate *** |
---|
38 | !! |
---|
39 | !! ** Purpose : Initialization of the dynamics and tracers |
---|
40 | !! Here WAD_TEST_CASES configuration |
---|
41 | !! |
---|
42 | !! ** Method : - set temprature field |
---|
43 | !! - set salinity field |
---|
44 | !!---------------------------------------------------------------------- |
---|
45 | REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(in ) :: pdept ! depth of t-point [m] |
---|
46 | REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(in ) :: ptmask ! t-point ocean mask [m] |
---|
47 | REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT( out) :: pts ! T & S fields [Celsius ; g/kg] |
---|
48 | REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT( out) :: pu ! i-component of the velocity [m/s] |
---|
49 | REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT( out) :: pv ! j-component of the velocity [m/s] |
---|
50 | REAL(wp), DIMENSION(jpi,jpj) , INTENT( out) :: pssh ! sea-surface height |
---|
51 | INTEGER :: ji, jj ! dummy loop indices |
---|
52 | REAL(wp) :: zi, zj |
---|
53 | ! |
---|
54 | INTEGER :: jk ! dummy loop indices |
---|
55 | REAL(wp) :: zdam ! location of dam [Km] |
---|
56 | !!---------------------------------------------------------------------- |
---|
57 | ! |
---|
58 | IF(lwp) WRITE(numout,*) |
---|
59 | IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD_TEST_CASES configuration, analytical definition of initial state' |
---|
60 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~ Ocean at rest, with a constant temperature ' |
---|
61 | IF(lwp) WRITE(numout,*) ' and constant salinity (not used as rho=F(T) ' |
---|
62 | ! |
---|
63 | ! |
---|
64 | pu (:,:,:) = 0._wp ! ocean at rest |
---|
65 | pv (:,:,:) = 0._wp |
---|
66 | pssh(:,:) = 0._wp |
---|
67 | ! |
---|
68 | ! ! T & S profiles |
---|
69 | pts(:,:,:,jp_tem) = 10._wp * ptmask(:,:,:) |
---|
70 | ! |
---|
71 | pts(:,:,:,jp_sal) = 35._wp * ptmask(:,:,:) |
---|
72 | !!---------------------------------------------------------------------- |
---|
73 | ! |
---|
74 | !!---------------------------------------------------------------------- |
---|
75 | ! |
---|
76 | ! Uniform T & S in most test cases |
---|
77 | pts(:,:,:,jp_tem) = 10._wp |
---|
78 | pts(:,:,:,jp_sal) = 35._wp |
---|
79 | SELECT CASE ( nn_cfg ) |
---|
80 | ! ! ==================== |
---|
81 | CASE ( 1 ) ! WAD 1 configuration |
---|
82 | ! ! ==================== |
---|
83 | ! |
---|
84 | IF(lwp) WRITE(numout,*) |
---|
85 | IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Closed box with EW linear bottom slope' |
---|
86 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~' |
---|
87 | ! |
---|
88 | do ji = 1,jpi |
---|
89 | pssh(ji,:) = ( -5.5_wp + 7.4_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1) |
---|
90 | end do |
---|
91 | ! ! ==================== |
---|
92 | CASE ( 2, 8 ) ! WAD 2 configuration |
---|
93 | ! ! ==================== |
---|
94 | ! |
---|
95 | IF(lwp) WRITE(numout,*) |
---|
96 | IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Parobolic EW channel, mid-range initial ssh slope' |
---|
97 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~' |
---|
98 | ! |
---|
99 | do ji = 1,jpi |
---|
100 | pssh(ji,:) = ( -1.5_wp + 5.0_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1) |
---|
101 | end do |
---|
102 | ! ! ==================== |
---|
103 | CASE ( 3 ) ! WAD 3 configuration |
---|
104 | ! ! ==================== |
---|
105 | ! |
---|
106 | IF(lwp) WRITE(numout,*) |
---|
107 | IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Parobolic EW channel, extreme initial ssh slope' |
---|
108 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~' |
---|
109 | ! |
---|
110 | do ji = 1,jpi |
---|
111 | pssh(ji,:) = ( -4.5_wp + 6.8_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1) |
---|
112 | end do |
---|
113 | |
---|
114 | ! |
---|
115 | ! ! ==================== |
---|
116 | CASE ( 4 ) ! WAD 4 configuration |
---|
117 | ! ! ==================== |
---|
118 | ! |
---|
119 | IF(lwp) WRITE(numout,*) |
---|
120 | IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Parobolic bowl, mid-range initial ssh slope' |
---|
121 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~' |
---|
122 | ! |
---|
123 | DO ji = 1, jpi |
---|
124 | zi = MAX(1.0-((glamt(ji,1)-25._wp)**2)/400.0, 0.0 ) |
---|
125 | DO jj = 1, jpj |
---|
126 | zj = MAX(1.0-((gphit(1,jj)-17._wp)**2)/144.0, 0.0 ) |
---|
127 | pssh(ji,jj) = -2.5_wp + 5.4_wp*zi*zj |
---|
128 | END DO |
---|
129 | END DO |
---|
130 | |
---|
131 | ! |
---|
132 | ! ! =========================== |
---|
133 | CASE ( 5, 7 ) ! WAD 5 and 7 configurations |
---|
134 | ! ! =========================== |
---|
135 | ! |
---|
136 | IF(lwp) WRITE(numout,*) |
---|
137 | IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Double slope with shelf' |
---|
138 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~' |
---|
139 | ! |
---|
140 | do ji = 1,jpi |
---|
141 | pssh(ji,:) = ( -2.5_wp + 5.5_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1) |
---|
142 | end do |
---|
143 | |
---|
144 | ! |
---|
145 | ! ! ==================== |
---|
146 | CASE ( 6 ) ! WAD 6 configuration |
---|
147 | ! ! ==================== |
---|
148 | ! |
---|
149 | IF(lwp) WRITE(numout,*) |
---|
150 | IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Parobolic EW channel with gaussian ridge' |
---|
151 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~' |
---|
152 | ! |
---|
153 | do ji = 1,jpi |
---|
154 | pssh(ji,:) = ( -2.5_wp + 5.5_wp*(50._wp-glamt(ji,1))/50._wp)*ptmask(ji,:,1) |
---|
155 | end do |
---|
156 | ! |
---|
157 | do ji = mi0(jpiglo/2), mi0(jpiglo) |
---|
158 | pts(ji,:,:,jp_sal) = 30._wp |
---|
159 | pssh(ji,:) = -0.1*ptmask(ji,:,1) |
---|
160 | end do |
---|
161 | ! |
---|
162 | ! |
---|
163 | ! ! =========================== |
---|
164 | CASE DEFAULT ! NONE existing configuration |
---|
165 | ! ! =========================== |
---|
166 | WRITE(ctmp1,*) 'WAD test with a ', nn_cfg,' option is not coded' |
---|
167 | ! |
---|
168 | CALL ctl_stop( ctmp1 ) |
---|
169 | ! |
---|
170 | END SELECT |
---|
171 | |
---|
172 | ! subtract the height of z=0 above the geoid (this allows z = 0 to be higher than all points that may become wet) |
---|
173 | pssh(:,:) = pssh(:,:) - rn_ssh_ref |
---|
174 | |
---|
175 | ! |
---|
176 | ! Apply minimum wetdepth criterion |
---|
177 | ! |
---|
178 | do jj = 1,jpj |
---|
179 | do ji = 1,jpi |
---|
180 | IF( ht_wd(ji,jj) + pssh(ji,jj) < rn_wdmin1 ) THEN |
---|
181 | pssh(ji,jj) = ptmask(ji,jj,1)*( rn_wdmin1 - ht_wd(ji,jj) ) |
---|
182 | ENDIF |
---|
183 | end do |
---|
184 | end do |
---|
185 | ! |
---|
186 | END SUBROUTINE usr_def_istate |
---|
187 | |
---|
188 | !!====================================================================== |
---|
189 | END MODULE usrdef_istate |
---|