Changeset 11536 for NEMO/trunk/src/SAS
- Timestamp:
- 2019-09-11T15:54:18+02:00 (5 years ago)
- Location:
- NEMO/trunk/src/SAS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/src/SAS/diawri.F90
r10425 r11536 125 125 !! define all the NETCDF files and fields 126 126 !! At each time step call histdef to compute the mean if ncessary 127 !! Each n write time step, output the instantaneous or mean fields127 !! Each nn_write time step, output the instantaneous or mean fields 128 128 !!---------------------------------------------------------------------- 129 129 !! … … 138 138 REAL(wp) :: zsto, zout, zmax, zjulian ! local scalars 139 139 !!---------------------------------------------------------------------- 140 !141 IF( ln_timing ) CALL timing_start('dia_wri')142 140 ! 143 141 ! Output the initial state and forcings … … 147 145 ENDIF 148 146 ! 147 IF( nn_write == -1 ) RETURN ! we will never do any output 148 ! 149 IF( ln_timing ) CALL timing_start('dia_wri') 150 ! 149 151 ! 0. Initialisation 150 152 ! ----------------- … … 159 161 ENDIF 160 162 #if defined key_diainstant 161 zsto = n write * rdt163 zsto = nn_write * rdt 162 164 clop = "inst("//TRIM(clop)//")" 163 165 #else … … 165 167 clop = "ave("//TRIM(clop)//")" 166 168 #endif 167 zout = n write * rdt169 zout = nn_write * rdt 168 170 zmax = ( nitend - nit000 + 1 ) * rdt 169 171 … … 196 198 ! WRITE root name in date.file for use by postpro 197 199 IF(lwp) THEN 198 CALL dia_nam( clhstnam, n write,' ' )200 CALL dia_nam( clhstnam, nn_write,' ' ) 199 201 CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 200 202 WRITE(inum,*) clhstnam … … 204 206 ! Define the T grid FILE ( nid_T ) 205 207 206 CALL dia_nam( clhstnam, n write, 'grid_T' )208 CALL dia_nam( clhstnam, nn_write, 'grid_T' ) 207 209 IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam ! filename 208 210 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & ! Horizontal grid: glamt and gphit … … 216 218 ! Define the U grid FILE ( nid_U ) 217 219 218 CALL dia_nam( clhstnam, n write, 'grid_U' )220 CALL dia_nam( clhstnam, nn_write, 'grid_U' ) 219 221 IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam ! filename 220 222 CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu, & ! Horizontal grid: glamu and gphiu … … 228 230 ! Define the V grid FILE ( nid_V ) 229 231 230 CALL dia_nam( clhstnam, n write, 'grid_V' ) ! filename232 CALL dia_nam( clhstnam, nn_write, 'grid_V' ) ! filename 231 233 IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam 232 234 CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv, & ! Horizontal grid: glamv and gphiv … … 291 293 ! donne le nombre d'elements, et ndex la liste des indices a sortir 292 294 293 IF( lwp .AND. MOD( itmod, n write ) == 0 ) THEN295 IF( lwp .AND. MOD( itmod, nn_write ) == 0 ) THEN 294 296 WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step' 295 297 WRITE(numout,*) '~~~~~~ ' -
NEMO/trunk/src/SAS/nemogcm.F90
r11229 r11536 151 151 ! 152 152 IF( nstop /= 0 .AND. lwp ) THEN ! error print 153 WRITE(numout,cform_err) 154 WRITE(numout,*) ' ==>>> nemo_gcm: a total of ', nstop, ' errors have been found' 155 WRITE(numout,*) 153 WRITE(ctmp1,*) ' ==>>> nemo_gcm: a total of ', nstop, ' errors have been found' 154 CALL ctl_stop( ctmp1 ) 156 155 ENDIF 157 156 ! … … 165 164 #else 166 165 IF ( lk_oasis ) THEN ; CALL cpl_finalize ! end coupling and mpp communications with OASIS 167 ELSEIF( lk_mpp ) THEN ; CALL mppstop ( ldfinal = .TRUE. )! end mpp communications166 ELSEIF( lk_mpp ) THEN ; CALL mppstop ! end mpp communications 168 167 ENDIF 169 168 #endif … … 171 170 IF(lwm) THEN 172 171 IF( nstop == 0 ) THEN ; STOP 0 173 ELSE ; STOP 999172 ELSE ; STOP 123 174 173 ENDIF 175 174 ENDIF … … 184 183 !! ** Purpose : initialization of the NEMO GCM 185 184 !!---------------------------------------------------------------------- 186 INTEGER :: ji ! dummy loop indices 187 INTEGER :: ios, ilocal_comm ! local integers 188 CHARACTER(len=120), DIMENSION(30) :: cltxt, cltxt2, clnam 189 CHARACTER(len=80) :: clname 185 INTEGER :: ios, ilocal_comm ! local integers 190 186 !! 191 187 NAMELIST/namctl/ ln_ctl , sn_cfctl, nn_print, nn_ictls, nn_ictle, & … … 195 191 !!---------------------------------------------------------------------- 196 192 ! 197 cltxt = '' 198 cltxt2 = '' 199 clnam = '' 200 cxios_context = 'nemo' 201 ! 202 ! ! Open reference namelist and configuration namelist files 203 IF( lk_oasis ) THEN 204 CALL ctl_opn( numnam_ref, 'namelist_sas_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 205 CALL ctl_opn( numnam_cfg, 'namelist_sas_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 206 cxios_context = 'sas' 207 clname = 'output.namelist_sas.dyn' 208 ELSE 209 CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 210 CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 211 cxios_context = 'nemo' 212 clname = 'output.namelist.dyn' 213 ENDIF 214 ! 215 REWIND( numnam_ref ) ! Namelist namctl in reference namelist 216 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 217 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 218 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist 219 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 220 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 221 ! 222 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist 223 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 224 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 225 REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist 226 READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 227 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) 228 229 ! !--------------------------! 230 ! ! Set global domain size ! (control print return in cltxt2) 231 ! !--------------------------! 232 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 233 CALL domain_cfg ( cltxt2, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 234 ! 235 ELSE ! user-defined namelist 236 CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 237 ENDIF 238 ! 239 ! 240 ! !--------------------------------------------! 241 ! ! set communicator & select the local node ! 242 ! ! NB: mynode also opens output.namelist.dyn ! 243 ! ! on unit number numond on first proc ! 244 ! !--------------------------------------------! 193 IF( lk_oasis ) THEN ; cxios_context = 'sas' 194 ELSE ; cxios_context = 'nemo' 195 ENDIF 196 ! 197 ! !-------------------------------------------------! 198 ! ! set communicator & select the local rank ! 199 ! ! must be done as soon as possible to get narea ! 200 ! !-------------------------------------------------! 201 ! 245 202 #if defined key_iomput 246 203 IF( Agrif_Root() ) THEN 247 204 IF( lk_oasis ) THEN 248 CALL cpl_init( "sas", ilocal_comm ) ! nemo local communicator given by oasis249 CALL xios_initialize( "not used",local_comm=ilocal_comm ) ! send nemo communicator to xios205 CALL cpl_init( "sas", ilocal_comm ) ! nemo local communicator given by oasis 206 CALL xios_initialize( "not used",local_comm=ilocal_comm ) ! send nemo communicator to xios 250 207 ELSE 251 208 CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) ! nemo local communicator given by xios 252 209 ENDIF 253 210 ENDIF 254 narea = mynode ( cltxt, clname, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) ! Nodes selection211 CALL mpp_start( ilocal_comm ) 255 212 #else 256 213 IF( lk_oasis ) THEN 257 214 IF( Agrif_Root() ) THEN 258 CALL cpl_init( "sas", ilocal_comm ) 215 CALL cpl_init( "sas", ilocal_comm ) ! nemo local communicator given by oasis 259 216 ENDIF 260 narea = mynode( cltxt, clname, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) ! Nodes selection (control print return in cltxt)217 CALL mpp_start( ilocal_comm ) 261 218 ELSE 262 ilocal_comm = 0 263 narea = mynode( cltxt, clname, numnam_ref, numnam_cfg, numond , nstop ) ! Nodes selection (control print return in cltxt) 264 ENDIF 265 #endif 266 267 narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) 268 269 IF( sn_cfctl%l_config ) THEN 270 ! Activate finer control of report outputs 271 ! optionally switch off output from selected areas (note this only 272 ! applies to output which does not involve global communications) 273 IF( ( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax ) .OR. & 274 & ( MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) ) & 275 & CALL nemo_set_cfctl( sn_cfctl, .FALSE., .FALSE. ) 219 CALL mpp_start( ) 220 ENDIF 221 #endif 222 ! 223 narea = mpprank + 1 ! mpprank: the rank of proc (0 --> mppsize -1 ) 224 lwm = (narea == 1) ! control of output namelists 225 ! 226 ! !---------------------------------------------------------------! 227 ! ! Open output files, reference and configuration namelist files ! 228 ! !---------------------------------------------------------------! 229 ! 230 ! open ocean.output as soon as possible to get all output prints (including errors messages) 231 IF( lk_oasis ) THEN 232 IF( lwm ) CALL ctl_opn( numout, 'sas.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 233 ! open reference and configuration namelist files 234 CALL ctl_opn( numnam_ref, 'namelist_sas_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 235 CALL ctl_opn( numnam_cfg, 'namelist_sas_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 236 IF( lwm ) CALL ctl_opn( numond, 'output.namelist_sas.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 276 237 ELSE 277 ! Use ln_ctl to turn on or off all options. 278 CALL nemo_set_cfctl( sn_cfctl, ln_ctl, .TRUE. ) 279 ENDIF 280 281 lwm = (narea == 1) ! control of output namelists 282 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print 283 284 IF(lwm) THEN ! write merged namelists from earlier to output namelist 285 ! ! now that the file has been opened in call to mynode. 286 ! ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 287 WRITE( numond, namctl ) 288 WRITE( numond, namcfg ) 289 IF( .NOT.ln_read_cfg ) THEN 290 DO ji = 1, SIZE(clnam) 291 IF( TRIM(clnam(ji)) /= '' ) WRITE(numond, * ) clnam(ji) ! namusr_def print 292 END DO 238 IF( lwm ) CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 239 ! open reference and configuration namelist files 240 CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 241 CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 242 IF( lwm ) CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 243 ENDIF 244 ! open /dev/null file to be able to supress output write easily 245 CALL ctl_opn( numnul, '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 246 ! 247 ! !--------------------! 248 ! ! Open listing units ! -> need ln_ctl from namctl to define lwp 249 ! !--------------------! 250 ! 251 REWIND( numnam_ref ) ! Namelist namctl in reference namelist 252 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 253 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist' ) 254 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist 255 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 256 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist' ) 257 ! 258 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print 259 ! 260 IF(lwp) THEN ! open listing units 261 ! 262 IF( .NOT. lwm ) THEN ! alreay opened for narea == 1 263 IF(lk_oasis) THEN ; CALL ctl_opn( numout, 'sas.output','REPLACE','FORMATTED','SEQUENTIAL',-1,-1, .FALSE., narea ) 264 ELSE ; CALL ctl_opn( numout, 'ocean.output','REPLACE','FORMATTED','SEQUENTIAL',-1,-1, .FALSE., narea ) 265 ENDIF 293 266 ENDIF 294 ENDIF295 296 IF(lwp) THEN ! open listing units297 !298 IF( lk_oasis ) THEN ; CALL ctl_opn( numout, 'sas.output', 'REPLACE','FORMATTED','SEQUENTIAL', -1, 6, .FALSE., narea )299 ELSE ; CALL ctl_opn( numout, 'ocean.output', 'REPLACE','FORMATTED','SEQUENTIAL', -1, 6, .FALSE., narea )300 ENDIF301 267 ! 302 268 WRITE(numout,*) 303 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV -CMCC'269 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - CMCC' 304 270 WRITE(numout,*) ' NEMO team' 305 271 WRITE(numout,*) ' Ocean General Circulation Model' … … 320 286 WRITE(numout,*) " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " 321 287 WRITE(numout,*) 322 323 DO ji = 1, SIZE(cltxt)324 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) TRIM(cltxt(ji)) ! control print of mynode325 END DO326 288 WRITE(numout,*) 327 WRITE(numout,*)328 DO ji = 1, SIZE(cltxt2)329 IF( TRIM(cltxt2(ji)) /= '' ) WRITE(numout,*) TRIM(cltxt2(ji)) ! control print of domain size330 END DO331 289 ! 332 290 WRITE(numout,cform_aaa) ! Flag AAAAAAA 333 291 ! 334 292 ENDIF 335 ! open /dev/null file to be able to supress output write easily 336 CALL ctl_opn( numnul, '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 337 ! 338 ! ! Domain decomposition 339 CALL mpp_init ! MPP 293 ! 294 ! finalize the definition of namctl variables 295 IF( sn_cfctl%l_config ) THEN 296 ! Activate finer control of report outputs 297 ! optionally switch off output from selected areas (note this only 298 ! applies to output which does not involve global communications) 299 IF( ( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax ) .OR. & 300 & ( MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) ) & 301 & CALL nemo_set_cfctl( sn_cfctl, .FALSE., .FALSE. ) 302 ELSE 303 ! Use ln_ctl to turn on or off all options. 304 CALL nemo_set_cfctl( sn_cfctl, ln_ctl, .TRUE. ) 305 ENDIF 306 ! 307 IF(lwm) WRITE( numond, namctl ) 308 ! 309 ! !------------------------------------! 310 ! ! Set global domain size parameters ! 311 ! !------------------------------------! 312 ! 313 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist 314 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 315 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist' ) 316 REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist 317 READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 318 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist' ) 319 ! 320 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 321 CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 322 ELSE ! user-defined namelist 323 CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 324 ENDIF 325 ! 326 IF(lwm) WRITE( numond, namcfg ) 327 ! 328 ! !-----------------------------------------! 329 ! ! mpp parameters and domain decomposition ! 330 ! !-----------------------------------------! 331 CALL mpp_init 340 332 341 333 ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays -
NEMO/trunk/src/SAS/sbcssm.F90
r10068 r11536 188 188 REWIND( numnam_ref ) ! Namelist namsbc_sas in reference namelist : Input fields 189 189 READ ( numnam_ref, namsbc_sas, IOSTAT = ios, ERR = 901) 190 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_sas in reference namelist' , lwp)190 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_sas in reference namelist' ) 191 191 REWIND( numnam_cfg ) ! Namelist namsbc_sas in configuration namelist : Input fields 192 192 READ ( numnam_cfg, namsbc_sas, IOSTAT = ios, ERR = 902 ) 193 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namsbc_sas in configuration namelist' , lwp)193 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namsbc_sas in configuration namelist' ) 194 194 IF(lwm) WRITE ( numond, namsbc_sas ) 195 195 ! -
NEMO/trunk/src/SAS/step.F90
r10425 r11536 96 96 ! From SAS: ocean bdy data are wrong (but we do not care) and ice bdy data are OK. 97 97 ! This is not clean and should be changed in the future. 98 IF( ln_bdy ) CALL bdy_dta ( kstp, time_offset=+1 ) ! update dynamic & tracer data at open boundaries98 IF( ln_bdy ) CALL bdy_dta ( kstp, kt_offset=+1 ) ! update dynamic & tracer data at open boundaries 99 99 ! ==> 100 100 CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice)
Note: See TracChangeset
for help on using the changeset viewer.