[3] | 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 | !! opa_flg : initialisation of algorithm flag |
---|
| 10 | !!---------------------------------------------------------------------- |
---|
| 11 | !! * Modules used |
---|
| 12 | USE dom_oce ! ocean space domain variables |
---|
| 13 | USE oce ! dynamics and tracers variables |
---|
| 14 | USE daymod ! calendar |
---|
| 15 | USE in_out_manager ! I/O manager |
---|
| 16 | USE lib_mpp ! distributed memory computing |
---|
| 17 | |
---|
| 18 | USE domcfg ! domain configuration (dom_cfg routine) |
---|
| 19 | USE mppini ! shared/distributed memory setting (mpp_init routine) |
---|
| 20 | USE domain ! domain initialization (dom_init routine) |
---|
| 21 | USE obc_par ! open boundary cond. parameters |
---|
| 22 | USE obcini ! open boundary cond. initialization (obc_ini routine) |
---|
| 23 | USE solver ! solver initialization (solver_init routine) |
---|
| 24 | USE istate ! initial state setting (istate_init routine) |
---|
| 25 | USE eosbn2 ! equation of state (eos bn2 routine) |
---|
| 26 | USE zpshde ! partial step: hor. derivative (zps_hde routine) |
---|
| 27 | |
---|
| 28 | ! ocean physics |
---|
| 29 | USE traqsr ! solar radiation penetration (tra_qsr_init routine) |
---|
| 30 | USE ldfdyn ! lateral viscosity setting (ldfdyn_init routine) |
---|
| 31 | USE ldftra ! lateral diffusivity setting (ldftra_init routine) |
---|
| 32 | USE zdfini |
---|
| 33 | !!!USE zdf_oce ! ocean vertical physics (zdf_init routine) |
---|
| 34 | |
---|
| 35 | USE phycst ! physical constant (par_cst routine) |
---|
| 36 | USE iceini ! initialization of sea-ice (ice_init routine) |
---|
| 37 | USE cpl ! coupled ocean/atmos. (cpl_init routine) |
---|
| 38 | USE ocfzpt ! ocean freezing point (oc_fz_pt routine) |
---|
| 39 | USE trddyn ! ocean momentum trends (trd_dyn_init routine) |
---|
| 40 | USE trdtra ! ocean active tracer trends (trd_tra_init routine) |
---|
| 41 | USE trdmld ! ocean active tracer mixed layer trend ??? |
---|
[109] | 42 | USE trdvor ! vorticity budget |
---|
[3] | 43 | USE flxfwb ! |
---|
| 44 | |
---|
| 45 | USE ptr ! poleward transports (dia_ptr_init routine) |
---|
| 46 | |
---|
| 47 | USE step ! OPA time-stepping (stp routine) |
---|
| 48 | |
---|
| 49 | IMPLICIT NONE |
---|
| 50 | PRIVATE |
---|
| 51 | |
---|
| 52 | !! * Routine accessibility |
---|
| 53 | PUBLIC opa_model ! called by model.F90 |
---|
| 54 | !!---------------------------------------------------------------------- |
---|
| 55 | !! OPA 9.0 , LODYC-IPSL (2003) |
---|
| 56 | !!---------------------------------------------------------------------- |
---|
| 57 | |
---|
| 58 | CONTAINS |
---|
| 59 | |
---|
| 60 | SUBROUTINE opa_model |
---|
| 61 | !!---------------------------------------------------------------------- |
---|
| 62 | !! *** ROUTINE opa *** |
---|
| 63 | !! |
---|
| 64 | !! ** Purpose : opa solves the primitive equations on an orthogonal |
---|
| 65 | !! curvilinear mesh on the sphere. |
---|
| 66 | !! |
---|
| 67 | !! ** Method : - model general initialization |
---|
| 68 | !! - launch the time-stepping (stp routine) |
---|
| 69 | !! |
---|
| 70 | !! References : |
---|
| 71 | !! Madec, Delecluse,Imbard, and Levy, 1997: reference manual. |
---|
| 72 | !! internal report, IPSL. |
---|
| 73 | !! |
---|
| 74 | !! History : |
---|
| 75 | !! 4.0 ! 90-10 (C. Levy, G. Madec) Original code |
---|
| 76 | !! 7.0 ! 91-11 (M. Imbard, C. Levy, G. Madec) |
---|
| 77 | !! 7.1 ! 93-03 (M. Imbard, C. Levy, G. Madec, O. Marti, |
---|
| 78 | !! M. Guyon, A. Lazar, P. Delecluse, C. Perigaud, |
---|
| 79 | !! G. Caniaux, B. Colot, C. Maes ) release 7.1 |
---|
| 80 | !! ! 92-06 (L.Terray) coupling implementation |
---|
| 81 | !! ! 93-11 (M.A. Filiberti) IGLOO sea-ice |
---|
| 82 | !! 8.0 ! 96-03 (M. Imbard, C. Levy, G. Madec, O. Marti, |
---|
| 83 | !! M. Guyon, A. Lazar, P. Delecluse, L.Terray, |
---|
| 84 | !! M.A. Filiberti, J. Vialar, A.M. Treguier, |
---|
| 85 | !! M. Levy) release 8.0 |
---|
| 86 | !! 8.1 ! 97-06 (M. Imbard, G. Madec) |
---|
| 87 | !! 8.2 ! 99-11 (M. Imbard, H. Goosse) LIM sea-ice model |
---|
| 88 | !! ! 99-12 (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols) OPEN-MP |
---|
| 89 | !! ! 00-07 (J-M Molines, M. Imbard) Open Boundary Conditions (CLIPPER) |
---|
| 90 | !! 9.0 ! 02-08 (G. Madec) F90: Free form and modules |
---|
| 91 | !!---------------------------------------------------------------------- |
---|
| 92 | !! * Local declarations |
---|
| 93 | INTEGER :: istp ! time step index |
---|
| 94 | #if defined key_coupled |
---|
| 95 | INTEGER :: itro, istp0 ! ??? |
---|
| 96 | #endif |
---|
| 97 | CHARACTER (len=64) :: & |
---|
| 98 | cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing |
---|
| 99 | !!---------------------------------------------------------------------- |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | ! Initializations |
---|
| 103 | ! =============== |
---|
| 104 | |
---|
| 105 | ! open listing and namelist units |
---|
| 106 | IF ( numout /= 0 .AND. numout /= 6 ) THEN |
---|
| 107 | OPEN( UNIT=numout, FILE='ocean.output', FORM='FORMATTED' ) |
---|
| 108 | ENDIF |
---|
[15] | 109 | IF( lk_mpp ) OPEN( UNIT=nummpp, FILE='mpp.output', FORM='FORMATTED' ) |
---|
[3] | 110 | |
---|
| 111 | |
---|
| 112 | ! Nodes selection |
---|
| 113 | narea = mynode() |
---|
| 114 | narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) |
---|
| 115 | lwp = narea == 1 |
---|
| 116 | |
---|
| 117 | OPEN( UNIT=numnam, FILE='namelist', FORM='FORMATTED', STATUS='OLD' ) |
---|
| 118 | |
---|
| 119 | IF(lwp) THEN |
---|
| 120 | WRITE(numout,*) |
---|
| 121 | WRITE(numout,*) ' L O D Y C - I P S L' |
---|
| 122 | WRITE(numout,*) ' O P A model' |
---|
| 123 | WRITE(numout,*) ' Ocean General Circulation Model' |
---|
| 124 | WRITE(numout,*) ' version OPA 9.0 (2003)' |
---|
| 125 | WRITE(numout,*) |
---|
| 126 | ENDIF |
---|
| 127 | |
---|
| 128 | ! ! ============================== ! |
---|
| 129 | ! ! Model general initialization ! |
---|
| 130 | ! ! ============================== ! |
---|
| 131 | |
---|
| 132 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 133 | |
---|
| 134 | ! Domain decomposition |
---|
| 135 | IF( jpni*jpnj == jpnij ) THEN |
---|
| 136 | CALL mpp_init ! standard cutting out |
---|
| 137 | ELSE |
---|
| 138 | CALL mpp_init2 ! eliminate land processors |
---|
| 139 | ENDIF |
---|
| 140 | |
---|
| 141 | CALL phy_cst ! Physical constants |
---|
| 142 | |
---|
| 143 | CALL dom_cfg ! Domain configuration |
---|
| 144 | |
---|
| 145 | CALL dom_init ! Domain |
---|
| 146 | |
---|
| 147 | IF( lk_obc ) CALL obc_init ! Open boundaries |
---|
| 148 | |
---|
| 149 | CALL solver_init ! Elliptic solver |
---|
| 150 | |
---|
| 151 | CALL day( nit000 ) ! Calendar |
---|
| 152 | |
---|
| 153 | CALL istate_init ! ocean initial state (Dynamics and tracers) |
---|
| 154 | !!add |
---|
| 155 | CALL eos( tb, sb, rhd, rhop ) ! before potential and in situ densities |
---|
| 156 | |
---|
| 157 | CALL bn2( tb, sb, rn2 ) ! before Brunt-Vaisala frequency |
---|
| 158 | |
---|
| 159 | IF( lk_zps ) CALL zps_hde( nit000, tb, sb, rhd, & ! Partial steps: before Horizontal DErivative |
---|
| 160 | gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level |
---|
| 161 | gtv, gsv, grv ) |
---|
| 162 | |
---|
| 163 | !!add |
---|
| 164 | |
---|
| 165 | CALL oc_fz_pt ! Surface freezing point |
---|
| 166 | |
---|
| 167 | #if defined key_ice_lim |
---|
| 168 | CALL ice_init ! Sea ice model |
---|
| 169 | #endif |
---|
| 170 | |
---|
| 171 | #if defined key_passivetrc |
---|
| 172 | CALL initrc ! Passive tracers |
---|
| 173 | #endif |
---|
| 174 | |
---|
[88] | 175 | ! ! Ocean scheme |
---|
| 176 | |
---|
| 177 | CALL opa_flg ! Choice of algorithms |
---|
| 178 | |
---|
[3] | 179 | ! ! Ocean physics |
---|
| 180 | |
---|
[88] | 181 | CALL tra_qsr_init ! Solar radiation penetration |
---|
[3] | 182 | |
---|
| 183 | CALL ldf_dyn_init ! Lateral ocean momentum physics |
---|
| 184 | |
---|
| 185 | CALL ldf_tra_init ! Lateral ocean tracer physics |
---|
| 186 | |
---|
| 187 | CALL zdf_init ! Vertical ocean physics |
---|
| 188 | |
---|
| 189 | ! ! Ocean trends |
---|
[109] | 190 | IF( lk_trddyn .OR. lk_trdvor) CALL trd_dyn_init ! momentum |
---|
[3] | 191 | IF( lk_trdtra .OR. lk_trdmld ) & |
---|
| 192 | & CALL trd_tra_init ! active tracers |
---|
| 193 | #if defined key_coupled |
---|
| 194 | itro = nitend - nit000 + 1 ! Coupled |
---|
| 195 | istp0 = NINT( rdt ) |
---|
| 196 | CALL cpl_init( itro, nexco, istp0 ) ! Signal processing and process id exchange |
---|
| 197 | #endif |
---|
| 198 | |
---|
| 199 | CALL flx_fwb_init ! FreshWater Budget correction |
---|
| 200 | |
---|
| 201 | #if defined key_diaptr |
---|
| 202 | CALL dia_ptr_init ! Poleward TRansports |
---|
| 203 | #endif |
---|
| 204 | |
---|
| 205 | ! ! =============== ! |
---|
| 206 | ! ! time stepping ! |
---|
| 207 | ! ! =============== ! |
---|
| 208 | |
---|
| 209 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 210 | |
---|
| 211 | istp = nit000 |
---|
| 212 | DO WHILE ( istp <= nitend .AND. nstop == 0 ) |
---|
| 213 | CALL stp( istp ) |
---|
| 214 | istp = istp + 1 |
---|
| 215 | END DO |
---|
| 216 | ! ! ========= ! |
---|
| 217 | ! ! Job end ! |
---|
| 218 | ! ! ========= ! |
---|
| 219 | |
---|
| 220 | IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA |
---|
| 221 | |
---|
| 222 | IF( nstop /= 0 ) THEN ! error print |
---|
| 223 | IF(lwp) WRITE(numout,cform_err) |
---|
| 224 | IF(lwp) WRITE(numout,*) nstop, ' error have been found' |
---|
| 225 | ENDIF |
---|
| 226 | |
---|
[15] | 227 | IF( lk_mpp ) CALL mppstop ! Close all files (mpp) |
---|
[3] | 228 | |
---|
| 229 | END SUBROUTINE opa_model |
---|
| 230 | |
---|
[15] | 231 | |
---|
[3] | 232 | SUBROUTINE opa_flg |
---|
| 233 | !!---------------------------------------------------------------------- |
---|
| 234 | !! *** ROUTINE opa *** |
---|
| 235 | !! |
---|
| 236 | !! ** Purpose : Initialize logical flags that control the choice of |
---|
| 237 | !! some algorithm or control print |
---|
| 238 | !! |
---|
| 239 | !! ** Method : Read in namilist namflg logical flags |
---|
| 240 | !! |
---|
| 241 | !! History : |
---|
| 242 | !! 9.0 ! 03-11 (G. Madec) Original code |
---|
| 243 | !!---------------------------------------------------------------------- |
---|
| 244 | !! * Local declarations |
---|
| 245 | |
---|
| 246 | NAMELIST/namflg/ ln_dynhpg_imp |
---|
| 247 | !!---------------------------------------------------------------------- |
---|
| 248 | |
---|
| 249 | ! Read Namelist namflg : algorithm FLaG |
---|
| 250 | ! -------------------- |
---|
| 251 | REWIND ( numnam ) |
---|
| 252 | READ ( numnam, namflg ) |
---|
| 253 | |
---|
| 254 | ! Parameter control and print |
---|
| 255 | ! --------------------------- |
---|
| 256 | ! Control print |
---|
| 257 | IF(lwp) THEN |
---|
| 258 | WRITE(numout,*) |
---|
| 259 | WRITE(numout,*) 'opa_flg : algorithm flag initialization' |
---|
| 260 | WRITE(numout,*) '~~~~~~~' |
---|
| 261 | WRITE(numout,*) ' Namelist namflg : set algorithm flags' |
---|
| 262 | WRITE(numout,*) |
---|
| 263 | WRITE(numout,*) ' centered (F) or semi-implicit (T) ln_dynhpg_imp = ', ln_dynhpg_imp |
---|
| 264 | WRITE(numout,*) ' hydrostatic pressure gradient' |
---|
| 265 | ENDIF |
---|
| 266 | |
---|
| 267 | END SUBROUTINE opa_flg |
---|
| 268 | |
---|
| 269 | !!====================================================================== |
---|
| 270 | END MODULE opa |
---|