1 | MODULE opa |
---|
2 | !!============================================================================== |
---|
3 | !! *** MODULE opa *** |
---|
4 | !! Ocean system : OPA ocean dynamics (including on-line tracers and sea-ice) |
---|
5 | !!============================================================================== |
---|
6 | |
---|
7 | !!---------------------------------------------------------------------- |
---|
8 | !! opa_model : solve ocean dynamics, tracer and/or sea-ice |
---|
9 | !!---------------------------------------------------------------------- |
---|
10 | !! * Modules used |
---|
11 | USE dom_oce ! ocean space domain variables |
---|
12 | USE oce ! dynamics and tracers variables |
---|
13 | USE daymod ! calendar |
---|
14 | USE in_out_manager ! I/O manager |
---|
15 | USE lib_mpp ! distributed memory computing |
---|
16 | |
---|
17 | USE domcfg ! domain configuration (dom_cfg routine) |
---|
18 | USE mppini ! shared/distributed memory setting (mpp_init routine) |
---|
19 | USE domain ! domain initialization (dom_init routine) |
---|
20 | USE istate ! initial state setting (istate_init routine) |
---|
21 | USE eosbn2 ! equation of state (eos bn2 routine) |
---|
22 | USE zpshde ! partial step: hor. derivative (zps_hde routine) |
---|
23 | |
---|
24 | ! ocean physics |
---|
25 | USE ldftra ! lateral diffusivity setting (ldftra_init routine) |
---|
26 | USE traqsr ! solar radiation penetration (tra_qsr_init routine) |
---|
27 | |
---|
28 | USE phycst ! physical constant (par_cst routine) |
---|
29 | USE dtadyn ! Lecture and Interpolation of the dynamical fields |
---|
30 | USE trcini ! Initilization of the passive tracers |
---|
31 | USE step ! OPA time-stepping (stp routine) |
---|
32 | |
---|
33 | IMPLICIT NONE |
---|
34 | PRIVATE |
---|
35 | |
---|
36 | !! * Routine accessibility |
---|
37 | PUBLIC opa_model ! called by model.F90 |
---|
38 | !!---------------------------------------------------------------------- |
---|
39 | !! OPA 9.0 , LOCEAN-IPSL (2005) |
---|
40 | !! $Header$ |
---|
41 | !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt |
---|
42 | !!---------------------------------------------------------------------- |
---|
43 | |
---|
44 | CONTAINS |
---|
45 | |
---|
46 | SUBROUTINE opa_model |
---|
47 | !!---------------------------------------------------------------------- |
---|
48 | !! *** ROUTINE opa *** |
---|
49 | !! |
---|
50 | !! ** Purpose : opa solves the primitive equations on an orthogonal |
---|
51 | !! curvilinear mesh on the sphere. |
---|
52 | !! |
---|
53 | !! ** Method : - model general initialization |
---|
54 | !! - launch the time-stepping (stp routine) |
---|
55 | !! |
---|
56 | !! References : |
---|
57 | !! Madec, Delecluse,Imbard, and Levy, 1997: reference manual. |
---|
58 | !! internal report, IPSL. |
---|
59 | !! |
---|
60 | !! History : |
---|
61 | !! 4.0 ! 90-10 (C. Levy, G. Madec) Original code |
---|
62 | !! 7.0 ! 91-11 (M. Imbard, C. Levy, G. Madec) |
---|
63 | !! 7.1 ! 93-03 (M. Imbard, C. Levy, G. Madec, O. Marti, |
---|
64 | !! M. Guyon, A. Lazar, P. Delecluse, C. Perigaud, |
---|
65 | !! G. Caniaux, B. Colot, C. Maes ) release 7.1 |
---|
66 | !! ! 92-06 (L.Terray) coupling implementation |
---|
67 | !! ! 93-11 (M.A. Filiberti) IGLOO sea-ice |
---|
68 | !! 8.0 ! 96-03 (M. Imbard, C. Levy, G. Madec, O. Marti, |
---|
69 | !! M. Guyon, A. Lazar, P. Delecluse, L.Terray, |
---|
70 | !! M.A. Filiberti, J. Vialar, A.M. Treguier, |
---|
71 | !! M. Levy) release 8.0 |
---|
72 | !! 8.1 ! 97-06 (M. Imbard, G. Madec) |
---|
73 | !! 8.2 ! 99-11 (M. Imbard, H. Goosse) LIM sea-ice model |
---|
74 | !! ! 99-12 (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols) OPEN-MP |
---|
75 | !! ! 00-07 (J-M Molines, M. Imbard) Open Boundary Conditions (CLIPPER) |
---|
76 | !! 9.0 ! 02-08 (G. Madec) F90: Free form and modules |
---|
77 | !!---------------------------------------------------------------------- |
---|
78 | !! * Local declarations |
---|
79 | INTEGER :: istp ! time step index |
---|
80 | CHARACTER (len=20) :: namelistname |
---|
81 | CHARACTER (len=28) :: file_out |
---|
82 | CHARACTER (len=64) :: & |
---|
83 | cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing |
---|
84 | |
---|
85 | !!---------------------------------------------------------------------- |
---|
86 | |
---|
87 | ! Initializations |
---|
88 | ! =============== |
---|
89 | |
---|
90 | file_out = 'ocean.output' |
---|
91 | |
---|
92 | ! open listing and namelist units |
---|
93 | CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED', & |
---|
94 | & 'SEQUENTIAL', 1, 6, .FALSE., 1 ) |
---|
95 | |
---|
96 | namelistname = 'namelist' |
---|
97 | CALL ctlopn( numnam, namelistname, 'OLD', 'FORMATTED', 'SEQUENTIAL', & |
---|
98 | & 1, numout, .FALSE., 1 ) |
---|
99 | |
---|
100 | WRITE(numout,*) |
---|
101 | WRITE(numout,*) ' L O D Y C - I P S L' |
---|
102 | WRITE(numout,*) ' O P A model' |
---|
103 | WRITE(numout,*) ' Ocean General Circulation Model' |
---|
104 | WRITE(numout,*) ' version OPA 9.0 (2005) ' |
---|
105 | WRITE(numout,*) |
---|
106 | WRITE(numout,*) |
---|
107 | |
---|
108 | ! Nodes selection |
---|
109 | narea = mynode() |
---|
110 | narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) |
---|
111 | lwp = narea == 1 |
---|
112 | |
---|
113 | ! open additionnal listing |
---|
114 | IF( ln_ctl ) THEN |
---|
115 | IF( narea-1 > 0 ) THEN |
---|
116 | WRITE(file_out,FMT="('ocean.output_',I4.4)") narea-1 |
---|
117 | CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED', & |
---|
118 | & 'SEQUENTIAL', 1, numout, .FALSE., 1 ) |
---|
119 | lwp = .TRUE. |
---|
120 | ! |
---|
121 | WRITE(numout,*) |
---|
122 | WRITE(numout,*) ' L O D Y C - I P S L' |
---|
123 | WRITE(numout,*) ' O P A model' |
---|
124 | WRITE(numout,*) ' Ocean General Circulation Model' |
---|
125 | WRITE(numout,*) ' version OPA 9.0 (2005) ' |
---|
126 | WRITE(numout,*) ' MPI Ocean output ' |
---|
127 | WRITE(numout,*) |
---|
128 | WRITE(numout,*) |
---|
129 | ENDIF |
---|
130 | ENDIF |
---|
131 | |
---|
132 | |
---|
133 | ! ! ============================== ! |
---|
134 | ! ! Model general initialization ! |
---|
135 | ! ! ============================== ! |
---|
136 | |
---|
137 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
138 | |
---|
139 | ! Domain decomposition |
---|
140 | IF( jpni*jpnj == jpnij ) THEN |
---|
141 | CALL mpp_init ! standard cutting out |
---|
142 | ELSE |
---|
143 | CALL mpp_init2 ! eliminate land processors |
---|
144 | ENDIF |
---|
145 | |
---|
146 | CALL phy_cst ! Physical constants |
---|
147 | |
---|
148 | CALL dom_cfg ! Domain configuration |
---|
149 | |
---|
150 | CALL dom_init ! Domain |
---|
151 | |
---|
152 | CALL day( nit000 ) ! Calendar |
---|
153 | |
---|
154 | CALL istate_init ! ocean initial state (Dynamics and tracers) |
---|
155 | !!add |
---|
156 | CALL eos( tn, sn, rhd, rhop ) ! before potential and in situ densities |
---|
157 | |
---|
158 | CALL bn2( tn, sn, rn2 ) ! before Brunt-Vaisala frequency |
---|
159 | |
---|
160 | IF( ln_zps ) CALL zps_hde( nit000, tn, sn, rhd, & ! Partial steps: before Horizontal DErivative |
---|
161 | gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level |
---|
162 | gtv, gsv, grv ) |
---|
163 | |
---|
164 | !!add |
---|
165 | |
---|
166 | ! Initialization for the dynamics |
---|
167 | ! |
---|
168 | CALL dta_dyn(nit000) |
---|
169 | |
---|
170 | #if defined key_top |
---|
171 | CALL trc_ini ! Passive tracers |
---|
172 | #endif |
---|
173 | |
---|
174 | ! ! Ocean physics |
---|
175 | CALL tra_qsr_init ! Solar radiation penetration |
---|
176 | |
---|
177 | #if ! defined key_off_degrad |
---|
178 | CALL ldf_tra_init ! Lateral ocean tracer physics |
---|
179 | #endif |
---|
180 | |
---|
181 | ! ! Ocean trends |
---|
182 | |
---|
183 | ! ! =============== ! |
---|
184 | ! ! time stepping ! |
---|
185 | ! ! =============== ! |
---|
186 | |
---|
187 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
188 | |
---|
189 | istp = nit000 |
---|
190 | DO WHILE ( istp <= nitend .AND. nstop == 0 ) |
---|
191 | CALL stp( istp ) |
---|
192 | istp = istp + 1 |
---|
193 | END DO |
---|
194 | ! ! ========= ! |
---|
195 | ! ! Job end ! |
---|
196 | ! ! ========= ! |
---|
197 | |
---|
198 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
199 | |
---|
200 | IF( nstop /= 0 ) THEN ! error print |
---|
201 | IF(lwp) WRITE(numout,cform_err) |
---|
202 | IF(lwp) WRITE(numout,*) nstop, ' error have been found' |
---|
203 | ENDIF |
---|
204 | |
---|
205 | IF( lk_mpp ) CALL mppstop ! Close all files (mpp) |
---|
206 | |
---|
207 | END SUBROUTINE opa_model |
---|
208 | |
---|
209 | !!====================================================================== |
---|
210 | END MODULE opa |
---|