Changeset 467 for trunk/NEMO/OPA_SRC/opa.F90
- Timestamp:
- 2006-05-10T19:44:38+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/opa.F90
r440 r467 7 7 !!---------------------------------------------------------------------- 8 8 !! opa_model : solve ocean dynamics, tracer and/or sea-ice 9 !! opa_init : initialization of the opa model 9 10 !! opa_flg : initialisation of algorithm flag 10 11 !! opa_closefile : close remaining files 12 !!---------------------------------------------------------------------- 13 !! History : 14 !! 4.0 ! 90-10 (C. Levy, G. Madec) Original code 15 !! 7.0 ! 91-11 (M. Imbard, C. Levy, G. Madec) 16 !! 7.1 ! 93-03 (M. Imbard, C. Levy, G. Madec, O. Marti, 17 !! M. Guyon, A. Lazar, P. Delecluse, C. Perigaud, 18 !! G. Caniaux, B. Colot, C. Maes ) release 7.1 19 !! ! 92-06 (L.Terray) coupling implementation 20 !! ! 93-11 (M.A. Filiberti) IGLOO sea-ice 21 !! 8.0 ! 96-03 (M. Imbard, C. Levy, G. Madec, O. Marti, 22 !! M. Guyon, A. Lazar, P. Delecluse, L.Terray, 23 !! M.A. Filiberti, J. Vialar, A.M. Treguier, 24 !! M. Levy) release 8.0 25 !! 8.1 ! 97-06 (M. Imbard, G. Madec) 26 !! 8.2 ! 99-11 (M. Imbard, H. Goosse) LIM sea-ice model 27 !! ! 99-12 (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols) OPEN-MP 28 !! ! 00-07 (J-M Molines, M. Imbard) Open Boundary Conditions (CLIPPER) 29 !! 9.0 ! 02-08 (G. Madec) F90: Free form and modules 30 !! " ! 04-08 (C. Talandier) New trends organization 31 !! " ! 05-06 (C. Ethe) Add the 1D configuration possibility 32 !! " ! 05-11 (V. Garnier) Surface pressure gradient organization 33 !! " ! 06-03 (L. Debreu, C. Mazauric) Agrif implementation 34 !! " ! 06-04 (G. Madec, R. Benshila) Step reorganization 11 35 !!---------------------------------------------------------------------- 12 36 !! * Modules used … … 30 54 31 55 ! ocean physics 32 USE traqsr ! solar radiation penetration (tra_qsr_init routine)33 56 USE ldfdyn ! lateral viscosity setting (ldfdyn_init routine) 34 57 USE ldftra ! lateral diffusivity setting (ldftra_init routine) … … 59 82 PRIVATE 60 83 84 !! * Module variables 85 CHARACTER (len=64) :: & 86 cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing 87 61 88 !! * Routine accessibility 62 89 PUBLIC opa_model ! called by model.F90 … … 65 92 !! OPA 9.0 , LOCEAN-IPSL (2005) 66 93 !! $Header$ 67 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt94 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 68 95 !!---------------------------------------------------------------------- 69 96 … … 83 110 !! Madec, Delecluse,Imbard, and Levy, 1997: reference manual. 84 111 !! internal report, IPSL. 85 !! 86 !! History : 87 !! 4.0 ! 90-10 (C. Levy, G. Madec) Original code 88 !! 7.0 ! 91-11 (M. Imbard, C. Levy, G. Madec) 89 !! 7.1 ! 93-03 (M. Imbard, C. Levy, G. Madec, O. Marti, 90 !! M. Guyon, A. Lazar, P. Delecluse, C. Perigaud, 91 !! G. Caniaux, B. Colot, C. Maes ) release 7.1 92 !! ! 92-06 (L.Terray) coupling implementation 93 !! ! 93-11 (M.A. Filiberti) IGLOO sea-ice 94 !! 8.0 ! 96-03 (M. Imbard, C. Levy, G. Madec, O. Marti, 95 !! M. Guyon, A. Lazar, P. Delecluse, L.Terray, 96 !! M.A. Filiberti, J. Vialar, A.M. Treguier, 97 !! M. Levy) release 8.0 98 !! 8.1 ! 97-06 (M. Imbard, G. Madec) 99 !! 8.2 ! 99-11 (M. Imbard, H. Goosse) LIM sea-ice model 100 !! ! 99-12 (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols) OPEN-MP 101 !! ! 00-07 (J-M Molines, M. Imbard) Open Boundary Conditions (CLIPPER) 102 !! 9.0 ! 02-08 (G. Madec) F90: Free form and modules 103 !! " ! 04-08 (C. Talandier) New trends organization 104 !! " ! 05-06 (C. Ethe) Add the 1D configuration possibility 105 !! " ! 05-11 (V. Garnier) Surface pressure gradient organization 106 !!---------------------------------------------------------------------- 107 !! * Local declarations 112 !!---------------------------------------------------------------------- 108 113 INTEGER :: istp ! time step index 109 CHARACTER (len=64) :: &110 cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing111 114 !!---------------------------------------------------------------------- 112 115 113 116 #if defined key_agrif 114 115 Call Agrif_Init_Grids() 117 CALL Agrif_Init_Grids() 116 118 #endif 117 119 118 C allopa_init ! Initializations119 120 IF( lk_cfg_1d )THEN120 CALL opa_init ! Initializations 121 122 IF( lk_cfg_1d ) THEN 121 123 istp = nit000 122 124 DO WHILE ( istp <= nitend .AND. nstop == 0 ) … … 156 158 157 159 160 SUBROUTINE opa_init 161 !!---------------------------------------------------------------------- 162 !! *** ROUTINE opa_init *** 163 !! 164 !! ** Purpose : initialization of the opa model 165 !! 166 !!---------------------------------------------------------------------- 167 #if defined key_coupled 168 INTEGER :: itro, istp0 ! ??? 169 #endif 170 CHARACTER (len=20) :: namelistname 171 CHARACTER (len=28) :: file_out 172 !!---------------------------------------------------------------------- 173 174 ! Initializations 175 ! =============== 176 177 file_out = 'ocean.output' 178 179 ! open listing and namelist units 180 IF ( numout /= 0 .AND. numout /= 6 ) THEN 181 CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED', & 182 & 'SEQUENTIAL', 1, numout, .FALSE., 1 ) 183 ENDIF 184 185 namelistname = 'namelist' 186 CALL ctlopn( numnam, namelistname, 'OLD', 'FORMATTED', 'SEQUENTIAL', & 187 & 1, numout, .FALSE., 1 ) 188 189 WRITE(numout,*) 190 WRITE(numout,*) ' L O D Y C - I P S L' 191 WRITE(numout,*) ' O P A model' 192 WRITE(numout,*) ' Ocean General Circulation Model' 193 WRITE(numout,*) ' version OPA 9.0 (2005) ' 194 WRITE(numout,*) 195 WRITE(numout,*) 196 197 ! Nodes selection 198 narea = mynode() 199 narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) 200 lwp = narea == 1 201 202 ! ! ============================== ! 203 ! ! Model general initialization ! 204 ! ! ============================== ! 205 206 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA 207 208 ! Domain decomposition 209 IF( jpni*jpnj == jpnij ) THEN 210 CALL mpp_init ! standard cutting out 211 ELSE 212 CALL mpp_init2 ! eliminate land processors 213 ENDIF 214 215 CALL phy_cst ! Physical constants 216 217 CALL dom_cfg ! Domain configuration 218 219 CALL dom_init ! Domain 220 221 IF( ln_ctl ) CALL prt_ctl_init ! Print control 222 223 IF( lk_cfg_1d ) CALL fcorio_1d ! redefine Coriolis at T-point 224 225 IF( lk_obc ) CALL obc_init ! Open boundaries 226 227 CALL day( nit000 ) ! Calendar 228 229 CALL istate_init ! ocean initial state (Dynamics and tracers) 230 231 IF( lk_dynspg_flt .OR. lk_dynspg_rl ) THEN 232 CALL solver_init( nit000 ) ! Elliptic solver 233 ENDIF 234 235 !!add 236 CALL eos( tb, sb, rhd, rhop ) ! before potential and in situ densities 237 238 CALL bn2( tb, sb, rn2 ) ! before Brunt-Vaisala frequency 239 240 IF( ln_zps .AND. .NOT. lk_cfg_1d ) & 241 & CALL zps_hde( nit000, tb, sb, rhd, & ! Partial steps: before Horizontal DErivative 242 gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level 243 gtv, gsv, grv ) 244 !!add 245 246 CALL oc_fz_pt ! Surface freezing point 247 248 #if defined key_ice_lim 249 CALL ice_init ! Sea ice model 250 #endif 251 252 ! ! Ocean scheme 253 254 CALL opa_flg ! Choice of algorithms 255 256 ! ! Ocean physics 257 258 CALL ldf_dyn_init ! Lateral ocean momentum physics 259 260 CALL ldf_tra_init ! Lateral ocean tracer physics 261 262 CALL zdf_init ! Vertical ocean physics 263 264 ! ! Ocean trends 265 ! Control parameters 266 IF( lk_trdtra .OR. lk_trdmld ) l_trdtra = .TRUE. 267 IF( lk_trddyn .OR. lk_trdvor ) l_trddyn = .TRUE. 268 269 IF( lk_trddyn .OR. lk_trdtra ) & 270 & CALL trd_icp_init ! active tracers and/or momentum 271 272 IF( lk_trdmld ) CALL trd_mld_init ! mixed layer 273 274 IF( lk_trdvor ) CALL trd_vor_init ! vorticity 275 276 #if defined key_passivetrc 277 CALL ini_trc ! Passive tracers 278 #endif 279 280 #if defined key_coupled 281 itro = nitend - nit000 + 1 ! Coupled 282 istp0 = NINT( rdt ) 283 CALL cpl_init( itro, nexco, istp0 ) ! Signal processing and process id exchange 284 #endif 285 286 CALL flx_init ! Thermohaline forcing initialization 287 288 CALL flx_fwb_init ! FreshWater Budget correction 289 290 CALL dia_ptr_init ! Poleward TRansports initialization 291 292 ! ! =============== ! 293 ! ! time stepping ! 294 ! ! =============== ! 295 296 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA 297 298 IF( lk_cfg_1d ) THEN 299 CALL init_1d 300 ENDIF 301 302 END SUBROUTINE opa_init 303 304 158 305 SUBROUTINE opa_flg 159 306 !!---------------------------------------------------------------------- … … 173 320 !!---------------------------------------------------------------------- 174 321 175 ! Read Namelist namflg : algorithm FLaG 322 ! Read Namelist namflg : algorithm FLaG 176 323 ! -------------------- 177 324 REWIND ( numnam ) … … 193 340 END SUBROUTINE opa_flg 194 341 342 195 343 SUBROUTINE opa_closefile 196 344 !!---------------------------------------------------------------------- … … 198 346 !! 199 347 !! ** Purpose : Close the files 200 !! 201 !! ** Method : 348 !! 349 !! ** Method : 202 350 !! 203 351 !! History : … … 236 384 237 385 !!====================================================================== 238 SUBROUTINE opa_init239 !!----------------------------------------------------------------------240 !! *** ROUTINE opa_init ***241 !!242 !! ** Purpose : initialization of the opa model243 !!244 !! ** Method :245 !!246 !! References :247 !!----------------------------------------------------------------------248 !! * Local declarations249 250 #if defined key_coupled251 INTEGER :: itro, istp0 ! ???252 #endif253 CHARACTER (len=64) :: &254 cform_aaa="( /, 'AAAAAAAA', / ) " ! flag for output listing255 CHARACTER (len=20) :: namelistname256 CHARACTER (len=28) :: file_out257 !!----------------------------------------------------------------------258 259 ! Initializations260 ! ===============261 262 file_out = 'ocean.output'263 264 ! open listing and namelist units265 IF ( numout /= 0 .AND. numout /= 6 ) THEN266 CALL ctlopn(numout,file_out,'UNKNOWN', 'FORMATTED', &267 'SEQUENTIAL',1,numout,.FALSE.,1)268 ! OPEN( UNIT=numout, FILE=TRIM(file_out), FORM='FORMATTED' )269 ENDIF270 271 namelistname = 'namelist'272 CALL ctlopn(numnam,namelistname,'OLD', 'FORMATTED', 'SEQUENTIAL', &273 1,numout,.FALSE.,1)274 !!!! OPEN( UNIT=numnam, FILE='namelist', FORM='FORMATTED', STATUS='OLD' )275 276 WRITE(numout,*)277 WRITE(numout,*) ' L O D Y C - I P S L'278 WRITE(numout,*) ' O P A model'279 WRITE(numout,*) ' Ocean General Circulation Model'280 WRITE(numout,*) ' version OPA 9.0 (2005) '281 WRITE(numout,*)282 WRITE(numout,*)283 284 ! Nodes selection285 narea = mynode()286 narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 )287 lwp = narea == 1288 289 ! ! ============================== !290 ! ! Model general initialization !291 ! ! ============================== !292 293 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA294 295 ! Domain decomposition296 IF( jpni*jpnj == jpnij ) THEN297 CALL mpp_init ! standard cutting out298 ELSE299 CALL mpp_init2 ! eliminate land processors300 ENDIF301 302 CALL phy_cst ! Physical constants303 304 CALL dom_cfg ! Domain configuration305 306 CALL dom_init ! Domain307 IF( ln_ctl ) CALL prt_ctl_init ! Print control308 309 IF( lk_cfg_1d ) CALL fcorio_1d ! redefine Coriolis at T-point310 311 IF( lk_obc ) CALL obc_init ! Open boundaries312 313 CALL day( nit000 ) ! Calendar314 315 CALL istate_init ! ocean initial state (Dynamics and tracers)316 317 IF( lk_dynspg_flt .OR. lk_dynspg_rl ) THEN318 CALL solver_init( nit000 ) ! Elliptic solver319 ENDIF320 321 !!add322 CALL eos( tb, sb, rhd, rhop ) ! before potential and in situ densities323 324 CALL bn2( tb, sb, rn2 ) ! before Brunt-Vaisala frequency325 326 IF( lk_zps .AND. .NOT. lk_cfg_1d ) &327 & CALL zps_hde( nit000, tb, sb, rhd, & ! Partial steps: before Horizontal DErivative328 gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level329 gtv, gsv, grv )330 331 !!add332 333 CALL oc_fz_pt ! Surface freezing point334 335 #if defined key_ice_lim336 CALL ice_init ! Sea ice model337 #endif338 339 ! ! Ocean scheme340 341 CALL opa_flg ! Choice of algorithms342 343 ! ! Ocean physics344 345 CALL tra_qsr_init ! Solar radiation penetration346 347 CALL ldf_dyn_init ! Lateral ocean momentum physics348 349 CALL ldf_tra_init ! Lateral ocean tracer physics350 351 CALL zdf_init ! Vertical ocean physics352 353 ! ! Ocean trends354 ! Control parameters355 IF( lk_trdtra .OR. lk_trdmld ) l_trdtra = .TRUE.356 IF( lk_trddyn .OR. lk_trdvor ) l_trddyn = .TRUE.357 358 IF( lk_trddyn .OR. lk_trdtra ) &359 & CALL trd_icp_init ! active tracers and/or momentum360 361 IF( lk_trdmld ) CALL trd_mld_init ! mixed layer362 363 IF( lk_trdvor ) CALL trd_vor_init ! vorticity364 365 #if defined key_passivetrc366 CALL ini_trc ! Passive tracers367 #endif368 369 #if defined key_coupled370 itro = nitend - nit000 + 1 ! Coupled371 istp0 = NINT( rdt )372 CALL cpl_init( itro, nexco, istp0 ) ! Signal processing and process id exchange373 #endif374 375 CALL flx_init ! Thermohaline forcing initialization376 377 CALL flx_fwb_init ! FreshWater Budget correction378 379 CALL dia_ptr_init ! Poleward TRansports initialization380 381 ! ! =============== !382 ! ! time stepping !383 ! ! =============== !384 385 IF(lwp) WRITE(numout,cform_aaa) ! Flag AAAAAAA386 387 IF( lk_cfg_1d ) THEN388 CALL init_1d389 ENDIF390 END SUBROUTINE opa_init391 !!======================================================================392 386 END MODULE opa
Note: See TracChangeset
for help on using the changeset viewer.