Changeset 1601 for trunk/NEMO/OPA_SRC/DOM/domain.F90
- Timestamp:
- 2009-08-11T12:09:19+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/DOM/domain.F90
r1488 r1601 5 5 !!============================================================================== 6 6 !! History : OPA ! 1990-10 (C. Levy - G. Madec) Original code 7 !! ! 1991-11 (G. Madec)8 7 !! ! 1992-01 (M. Imbard) insert time step initialization 9 8 !! ! 1996-06 (G. Madec) generalized vertical coordinate … … 23 22 USE sbc_oce ! surface boundary condition: ocean 24 23 USE phycst ! physical constants 24 USE closea ! closed seas 25 25 USE in_out_manager ! I/O manager 26 26 USE lib_mpp ! distributed memory computing library … … 31 31 USE dommsk ! domain: set the mask system 32 32 USE domwri ! domain: write the meshmask file 33 USE closea ! closed sea or lake (dom_clo routine)34 33 USE domvvl ! variable volume 35 34 … … 54 53 !! 55 54 !! ** Purpose : Domain initialization. Call the routines that are 56 !! required to create the arrays which define the space and time57 !! domain of the ocean model.55 !! required to create the arrays which define the space 56 !! and time domain of the ocean model. 58 57 !! 59 !! ** Method : 60 !! - dom_msk: compute the masks from the bathymetry file 61 !! - dom_hgr: compute or read the horizontal grid-point position and 62 !! scale factors, and the coriolis factor 63 !! - dom_zgr: define the vertical coordinate system and the bathymetry 64 !! - dom_stp: defined the model time step 65 !! - dom_wri: create the meshmask file if nmsh=1 58 !! ** Method : - dom_msk: compute the masks from the bathymetry file 59 !! - dom_hgr: compute or read the horizontal grid-point position 60 !! and scale factors, and the coriolis factor 61 !! - dom_zgr: define the vertical coordinate and the bathymetry 62 !! - dom_stp: defined the model time step 63 !! - dom_wri: create the meshmask file if nmsh=1 66 64 !!---------------------------------------------------------------------- 67 65 INTEGER :: jk ! dummy loop argument 68 66 INTEGER :: iconf = 0 ! temporary integers 69 67 !!---------------------------------------------------------------------- 70 68 ! 71 69 IF(lwp) THEN 72 70 WRITE(numout,*) … … 74 72 WRITE(numout,*) '~~~~~~~~' 75 73 ENDIF 76 77 CALL dom_nam ! read namelist ( namrun, namdom, namcla ) 78 79 CALL dom_clo ! Closed seas and lake 80 81 CALL dom_hgr ! Horizontal mesh 82 83 CALL dom_zgr ! Vertical mesh and bathymetry 84 85 CALL dom_msk ! Masks 86 87 IF( lk_vvl ) CALL dom_vvl ! Vertical variable mesh 88 89 ! Local depth or Inverse of the local depth of the water column at u- and v-points 90 ! ------------------------------ 91 ! Ocean depth at U- and V-points 92 hu(:,:) = 0.e0 74 ! 75 CALL dom_nam ! read namelist ( namrun, namdom, namcla ) 76 CALL dom_clo ! Closed seas and lake 77 CALL dom_hgr ! Horizontal mesh 78 CALL dom_zgr ! Vertical mesh and bathymetry 79 CALL dom_msk ! Masks 80 IF( lk_vvl ) CALL dom_vvl ! Vertical variable mesh 81 ! 82 hu(:,:) = 0.e0 ! Ocean depth at U- and V-points 93 83 hv(:,:) = 0.e0 94 84 DO jk = 1, jpk … … 96 86 hv(:,:) = hv(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) 97 87 END DO 98 ! Inverse of the local depth 99 hur(:,:) = fse3u(:,:,1) ! Lower bound : thickness of the first model level 100 hvr(:,:) = fse3v(:,:,1) 101 DO jk = 2, jpk ! Sum of the vertical scale factors 102 hur(:,:) = hur(:,:) + fse3u(:,:,jk) * umask(:,:,jk) 103 hvr(:,:) = hvr(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) 104 END DO 105 ! Compute and mask the inverse of the local depth 106 hur(:,:) = 1. / hur(:,:) * umask(:,:,1) 107 hvr(:,:) = 1. / hvr(:,:) * vmask(:,:,1) 108 109 CALL dom_stp ! Time step 110 111 IF( nmsh /= 0 ) CALL dom_wri ! Create a domain file 112 113 IF( .NOT.ln_rstart ) CALL dom_ctl ! Domain control 88 ! ! Inverse of the local depth 89 hur(:,:) = 1. / ( hu(:,:) + 1.e0 - umask(:,:,1) ) * umask(:,:,1) 90 hvr(:,:) = 1. / ( hv(:,:) + 1.e0 - vmask(:,:,1) ) * vmask(:,:,1) 91 92 CALL dom_stp ! time step 93 IF( nmsh /= 0 ) CALL dom_wri ! Create a domain file 94 IF( .NOT.ln_rstart ) CALL dom_ctl ! Domain control 114 95 ! 115 96 END SUBROUTINE dom_init … … 127 108 !!---------------------------------------------------------------------- 128 109 USE ioipsl 129 NAMELIST/namrun/ no , cexper, cn_ocerst_in, cn_ocerst_out, ln_rstart, nrstdt, & 130 & nit000, nitend, ndate0 , nleapy , ninist , nstock, & 131 & nwrite, ln_dimgnnn, ln_mskland, ln_clobber, nn_chunksz 132 133 NAMELIST/namdom/ ntopo , e3zps_min, e3zps_rat, nmsh , & 134 & nacc , atfp , rdt , rdtmin , & 135 & rdtmax, rdth , nn_baro , nclosea 136 NAMELIST/namcla/ n_cla 137 !!---------------------------------------------------------------------- 138 139 IF(lwp) THEN 110 NAMELIST/namrun/ nn_no , cn_exp , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl, & 111 & nn_it000, nn_itend , nn_date0 , nn_leapy , nn_istate , nn_stock , & 112 & nn_write, ln_dimgnnn, ln_mskland , ln_clobber , nn_chunksz 113 NAMELIST/namdom/ nn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh , & 114 & nn_acc , rn_atfp , rn_rdt , rn_rdtmin, & 115 & rn_rdtmax, rn_rdth , nn_baro , nn_closea 116 NAMELIST/namcla/ nn_cla 117 !!---------------------------------------------------------------------- 118 119 REWIND( numnam ) ! Namelist namrun : parameters of the run 120 READ ( numnam, namrun ) 121 ! 122 IF(lwp) THEN ! control print 140 123 WRITE(numout,*) 141 124 WRITE(numout,*) 'dom_nam : domain initialization through namelist read' 142 125 WRITE(numout,*) '~~~~~~~ ' 143 ENDIF 144 145 REWIND( numnam ) ! Namelist namrun : parameters of the run 146 READ ( numnam, namrun ) 147 IF(lwp) THEN 148 WRITE(numout,*) ' Namelist namrun' 149 WRITE(numout,*) ' job number no = ', no 150 WRITE(numout,*) ' experiment name for output cexper = ', cexper 151 WRITE(numout,*) ' restart logical ln_rstart = ', ln_rstart 152 WRITE(numout,*) ' control of time step nrstdt = ', nrstdt 153 WRITE(numout,*) ' number of the first time step nit000 = ', nit000 154 WRITE(numout,*) ' number of the last time step nitend = ', nitend 155 WRITE(numout,*) ' initial calendar date aammjj ndate0 = ', ndate0 156 WRITE(numout,*) ' leap year calendar (0/1) nleapy = ', nleapy 157 WRITE(numout,*) ' initial state output ninist = ', ninist 158 WRITE(numout,*) ' frequency of restart file nstock = ', nstock 159 WRITE(numout,*) ' frequency of output file nwrite = ', nwrite 160 WRITE(numout,*) ' multi file dimgout ln_dimgnnn = ', ln_dimgnnn 161 WRITE(numout,*) ' mask land points ln_mskland = ', ln_mskland 162 WRITE(numout,*) ' overwrite an existing file ln_clobber = ', ln_clobber 163 WRITE(numout,*) ' NetCDF chunksize (bytes) nn_chunksz = ', nn_chunksz 164 ENDIF 165 166 ! ... Control of output frequency 126 WRITE(numout,*) ' Namelist namrun' 127 WRITE(numout,*) ' job number nn_no = ', nn_no 128 WRITE(numout,*) ' experiment name for output cn_exp = ', cn_exp 129 WRITE(numout,*) ' restart logical ln_rstart = ', ln_rstart 130 WRITE(numout,*) ' control of time step nn_rstdt = ', nn_rstctl 131 WRITE(numout,*) ' number of the first time step nn_it000 = ', nn_it000 132 WRITE(numout,*) ' number of the last time step nn_itend = ', nn_itend 133 WRITE(numout,*) ' initial calendar date aammjj nn_date0 = ', nn_date0 134 WRITE(numout,*) ' leap year calendar (0/1) nn_leapy = ', nn_leapy 135 WRITE(numout,*) ' initial state output nn_istate = ', nn_istate 136 WRITE(numout,*) ' frequency of restart file nn_stock = ', nn_stock 137 WRITE(numout,*) ' frequency of output file nn_write = ', nn_write 138 WRITE(numout,*) ' multi file dimgout ln_dimgnnn = ', ln_dimgnnn 139 WRITE(numout,*) ' mask land points ln_mskland = ', ln_mskland 140 WRITE(numout,*) ' overwrite an existing file ln_clobber = ', ln_clobber 141 WRITE(numout,*) ' NetCDF chunksize (bytes) nn_chunksz = ', nn_chunksz 142 ENDIF 143 144 no = nn_no ! conversion DOCTOR names into model names (this should disappear soon) 145 cexper = cn_exp 146 nrstdt = nn_rstctl 147 nit000 = nn_it000 148 nitend = nn_itend 149 ndate0 = nn_date0 150 nleapy = nn_leapy 151 ninist = nn_istate 152 nstock = nn_stock 153 nwrite = nn_write 154 155 156 ! ! control of output frequency 167 157 IF ( nstock == 0 .OR. nstock > nitend ) THEN 168 WRITE(ctmp1,*) ' 158 WRITE(ctmp1,*) 'nstock = ', nstock, ' it is forced to ', nitend 169 159 CALL ctl_warn( ctmp1 ) 170 160 nstock = nitend 171 161 ENDIF 172 162 IF ( nwrite == 0 ) THEN 173 WRITE(ctmp1,*) ' 163 WRITE(ctmp1,*) 'nwrite = ', nwrite, ' it is forced to ', nitend 174 164 CALL ctl_warn( ctmp1 ) 175 165 nwrite = nitend … … 177 167 178 168 #if defined key_agrif 179 if ( Agrif_Root() ) then169 IF( Agrif_Root() ) THEN 180 170 #endif 181 SELECT CASE ( nleapy ) ! Choose calendar for IOIPSL171 SELECT CASE ( nleapy ) ! Choose calendar for IOIPSL 182 172 CASE ( 1 ) 183 173 CALL ioconf_calendar('gregorian') 184 IF(lwp) WRITE(numout,*) ' 174 IF(lwp) WRITE(numout,*) ' The IOIPSL calendar is "gregorian", i.e. leap year' 185 175 CASE ( 0 ) 186 176 CALL ioconf_calendar('noleap') 187 IF(lwp) WRITE(numout,*) ' 177 IF(lwp) WRITE(numout,*) ' The IOIPSL calendar is "noleap", i.e. no leap year' 188 178 CASE ( 30 ) 189 179 CALL ioconf_calendar('360d') 190 IF(lwp) WRITE(numout,*) ' 180 IF(lwp) WRITE(numout,*) ' The IOIPSL calendar is "360d", i.e. 360 days in a year' 191 181 END SELECT 192 182 #if defined key_agrif 193 endif183 ENDIF 194 184 #endif 195 185 196 SELECT CASE ( nleapy ) ! year=raajj*days day=rjjhh*hours hour=rhhmm*minutes etc ...186 SELECT CASE ( nleapy ) ! year=raajj*days day=rjjhh*hours hour=rhhmm*minutes etc ... 197 187 CASE ( 1 ) 198 188 raajj = 365.25 … … 210 200 IF(lwp) THEN 211 201 WRITE(numout,*) 212 WRITE(numout,*) ' 213 WRITE(numout,*) ' 214 WRITE(numout,*) ' 215 ENDIF 216 217 REWIND( numnam ) ! Namelist namdom : space/time domain (bathymetry, mesh, timestep)202 WRITE(numout,*) ' nb of days per year raajj = ', raajj,' days' 203 WRITE(numout,*) ' nb of seconds per year raass = ', raass, ' s' 204 WRITE(numout,*) ' nb of seconds per month rmoss = ', rmoss, ' s' 205 ENDIF 206 207 REWIND( numnam ) ! Namelist namdom : space & time domain (bathymetry, mesh, timestep) 218 208 READ ( numnam, namdom ) 219 209 220 210 IF(lwp) THEN 221 211 WRITE(numout,*) 222 WRITE(numout,*) ' Namelist namdom' 223 WRITE(numout,*) ' flag read/compute bathymetry ntopo = ', ntopo 224 WRITE(numout,*) ' minimum thickness of partial e3zps_min = ', e3zps_min, ' (m)' 225 WRITE(numout,*) ' step level e3zps_rat = ', e3zps_rat 226 WRITE(numout,*) ' flag write mesh/mask file(s) nmsh = ', nmsh 227 WRITE(numout,*) ' = 0 no file created ' 228 WRITE(numout,*) ' = 1 mesh_mask ' 229 WRITE(numout,*) ' = 2 mesh and mask ' 230 WRITE(numout,*) ' = 3 mesh_hgr, msh_zgr and mask ' 231 WRITE(numout,*) ' acceleration of converge nacc = ', nacc 232 WRITE(numout,*) ' asselin time filter parameter atfp = ', atfp 233 WRITE(numout,*) ' time step rdt = ', rdt 234 WRITE(numout,*) ' minimum time step on tracers rdtmin = ', rdtmin 235 WRITE(numout,*) ' maximum time step on tracers rdtmax = ', rdtmax 236 WRITE(numout,*) ' depth variation tracer step rdth = ', rdth 237 WRITE(numout,*) ' number of barotropic time step nn_baro = ', nn_baro 238 ENDIF 239 240 n_cla = 0 241 REWIND( numnam ) ! Namelist cross land advection 212 WRITE(numout,*) ' Namelist namdom : space & time domain' 213 WRITE(numout,*) ' flag read/compute bathymetry nn_bathy = ', nn_bathy 214 WRITE(numout,*) ' minimum thickness of partial rn_e3zps_min = ', rn_e3zps_min, ' (m)' 215 WRITE(numout,*) ' step level rn_e3zps_rat = ', rn_e3zps_rat 216 WRITE(numout,*) ' create mesh/mask file(s) nn_msh = ', nn_msh 217 WRITE(numout,*) ' = 0 no file created ' 218 WRITE(numout,*) ' = 1 mesh_mask ' 219 WRITE(numout,*) ' = 2 mesh and mask ' 220 WRITE(numout,*) ' = 3 mesh_hgr, msh_zgr and mask ' 221 WRITE(numout,*) ' ocean time step rn_rdt = ', rn_rdt 222 WRITE(numout,*) ' asselin time filter parameter rn_atfp = ', rn_atfp 223 WRITE(numout,*) ' time-splitting: nb of sub time-step nn_baro = ', nn_baro 224 WRITE(numout,*) ' acceleration of converge nn_acc = ', nn_acc 225 WRITE(numout,*) ' nn_acc=1: surface tracer rdt rn_rdtmin = ', rn_rdtmin 226 WRITE(numout,*) ' bottom tracer rdt rdtmax = ', rn_rdtmax 227 WRITE(numout,*) ' depth of transition rn_rdth = ', rn_rdth 228 WRITE(numout,*) ' suppression of closed seas (=0) nn_closea = ', nn_closea 229 ENDIF 230 231 ntopo = nn_bathy ! conversion DOCTOR names into model names (this should disappear soon) 232 e3zps_min = rn_e3zps_min 233 e3zps_rat = rn_e3zps_rat 234 nmsh = nn_msh 235 nacc = nn_acc 236 atfp = rn_atfp 237 rdt = rn_rdt 238 rdtmin = rn_rdtmin 239 rdtmax = rn_rdtmin 240 rdth = rn_rdth 241 nclosea = nn_closea 242 243 REWIND( numnam ) ! Namelist cross land advection 242 244 READ ( numnam, namcla ) 243 245 IF(lwp) THEN 244 246 WRITE(numout,*) 245 WRITE(numout,*) ' Namelist namcla' 246 WRITE(numout,*) ' cross land advection n_cla = ',n_cla 247 ENDIF 247 WRITE(numout,*) ' Namelist namcla' 248 WRITE(numout,*) ' cross land advection nn_cla = ', nn_cla 249 ENDIF 250 251 n_cla = nn_cla ! conversion DOCTOR names into model names (this should disappear soon) 248 252 249 253 IF( nbit_cmp == 1 .AND. n_cla /= 0 ) CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require n_cla = 0' ) … … 261 265 !!---------------------------------------------------------------------- 262 266 INTEGER :: iimi1, ijmi1, iimi2, ijmi2, iima1, ijma1, iima2, ijma2 263 INTEGER, DIMENSION(2) :: iloc 267 INTEGER, DIMENSION(2) :: iloc ! 264 268 REAL(wp) :: ze1min, ze1max, ze2min, ze2max 265 269 !!---------------------------------------------------------------------- 266 267 IF(lwp)WRITE(numout,*) 268 IF(lwp)WRITE(numout,*) 'dom_ctl : extrema of the masked scale factors' 269 IF(lwp)WRITE(numout,*) '~~~~~~~' 270 271 IF (lk_mpp) THEN 270 ! 271 IF(lk_mpp) THEN 272 272 CALL mpp_minloc( e1t(:,:), tmask(:,:,1), ze1min, iimi1,ijmi1 ) 273 273 CALL mpp_minloc( e2t(:,:), tmask(:,:,1), ze2min, iimi2,ijmi2 ) … … 293 293 ijma2 = iloc(2) + njmpp - 1 294 294 ENDIF 295 296 IF(lwp) THEN 295 IF(lwp) THEN 296 WRITE(numout,*) 297 WRITE(numout,*) 'dom_ctl : extrema of the masked scale factors' 298 WRITE(numout,*) '~~~~~~~' 297 299 WRITE(numout,"(14x,'e1t maxi: ',1f10.2,' at i = ',i5,' j= ',i5)") ze1max, iima1, ijma1 298 300 WRITE(numout,"(14x,'e1t mini: ',1f10.2,' at i = ',i5,' j= ',i5)") ze1min, iimi1, ijmi1
Note: See TracChangeset
for help on using the changeset viewer.