Changeset 11822 for NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OFF/nemogcm.F90
- Timestamp:
- 2019-10-29T11:41:36+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OFF/nemogcm.F90
r11763 r11822 144 144 145 145 IF( nstop /= 0 .AND. lwp ) THEN ! error print 146 WRITE(numout,cform_err) 147 WRITE(numout,*) ' ==>>> nemo_gcm: a total of ', nstop, ' errors have been found' 148 WRITE(numout,*) 146 WRITE(ctmp1,*) ' ==>>> nemo_gcm: a total of ', nstop, ' errors have been found' 147 CALL ctl_stop( ctmp1 ) 149 148 ENDIF 150 149 ! … … 159 158 #endif 160 159 ! 160 IF(lwm) THEN 161 IF( nstop == 0 ) THEN ; STOP 0 162 ELSE ; STOP 123 163 ENDIF 164 ENDIF 165 ! 161 166 END SUBROUTINE nemo_gcm 162 167 … … 168 173 !! ** Purpose : initialization of the nemo model in off-line mode 169 174 !!---------------------------------------------------------------------- 170 INTEGER :: ji ! dummy loop indices 171 INTEGER :: ios, ilocal_comm ! local integers 172 CHARACTER(len=120), DIMENSION(30) :: cltxt, cltxt2, clnam 175 INTEGER :: ios, ilocal_comm ! local integers 173 176 !! 174 177 NAMELIST/namctl/ ln_ctl , sn_cfctl, nn_print, nn_ictls, nn_ictle, & … … 178 181 !!---------------------------------------------------------------------- 179 182 ! 180 cltxt = ''181 cltxt2 = ''182 clnam = ''183 183 cxios_context = 'nemo' 184 184 ! 185 ! ! Open reference namelist and configuration namelist files 186 CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 187 CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 185 ! !-------------------------------------------------! 186 ! ! set communicator & select the local rank ! 187 ! ! must be done as soon as possible to get narea ! 188 ! !-------------------------------------------------! 189 ! 190 #if defined key_iomput 191 CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm ) ! nemo local communicator given by xios 192 CALL mpp_start( ilocal_comm ) 193 #else 194 CALL mpp_start( ) 195 #endif 196 ! 197 narea = mpprank + 1 ! mpprank: the rank of proc (0 --> mppsize -1 ) 198 lwm = (narea == 1) ! control of output namelists 199 ! 200 ! !---------------------------------------------------------------! 201 ! ! Open output files, reference and configuration namelist files ! 202 ! !---------------------------------------------------------------! 203 ! 204 ! open ocean.output as soon as possible to get all output prints (including errors messages) 205 IF( lwm ) CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 206 ! open reference and configuration namelist files 207 CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 208 CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 209 IF( lwm ) CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 210 ! open /dev/null file to be able to supress output write easily 211 CALL ctl_opn( numnul, '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 212 ! 213 ! !--------------------! 214 ! ! Open listing units ! -> need ln_ctl from namctl to define lwp 215 ! !--------------------! 188 216 ! 189 217 REWIND( numnam_ref ) ! Namelist namctl in reference namelist 190 218 READ ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 191 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist' , .TRUE.)219 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist' ) 192 220 REWIND( numnam_cfg ) ! Namelist namctl in confguration namelist 193 221 READ ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 194 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 195 ! 196 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist 197 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 198 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 199 REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist 200 READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 201 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) 202 203 ! !--------------------------! 204 ! ! Set global domain size ! (control print return in cltxt2) 205 ! !--------------------------! 206 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 207 CALL domain_cfg ( cltxt2, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 208 ! 209 ELSE ! user-defined namelist 210 CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 211 ENDIF 212 ! 213 l_offline = .true. ! passive tracers are run offline 214 ! 215 ! !--------------------------------------------! 216 ! ! set communicator & select the local node ! 217 ! ! NB: mynode also opens output.namelist.dyn ! 218 ! ! on unit number numond on first proc ! 219 ! !--------------------------------------------! 220 #if defined key_iomput 221 CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) 222 narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) ! Nodes selection 223 #else 224 ilocal_comm = 0 225 narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop ) ! Nodes selection (control print return in cltxt) 226 #endif 227 228 narea = narea + 1 ! mynode return the rank of proc (0 --> jpnij -1 ) 229 222 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist' ) 223 ! 224 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print 225 ! 226 IF(lwp) THEN ! open listing units 227 ! 228 IF( .NOT. lwm ) & ! alreay opened for narea == 1 229 & CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., narea ) 230 ! 231 WRITE(numout,*) 232 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - CMCC' 233 WRITE(numout,*) ' NEMO team' 234 WRITE(numout,*) ' Off-line TOP Model' 235 WRITE(numout,*) ' NEMO version 4.0 (2019) ' 236 WRITE(numout,*) 237 WRITE(numout,*) " ._ ._ ._ ._ ._ " 238 WRITE(numout,*) " _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ " 239 WRITE(numout,*) 240 WRITE(numout,*) " o _, _, " 241 WRITE(numout,*) " o .' ( .-' / " 242 WRITE(numout,*) " o _/..._'. .' / " 243 WRITE(numout,*) " ( o .-'` ` '-./ _.' " 244 WRITE(numout,*) " ) ( o) ;= <_ ( " 245 WRITE(numout,*) " ( '-.,\\__ __.-;`\ '. ) " 246 WRITE(numout,*) " ) ) \) |`\ \) '. \ ( ( " 247 WRITE(numout,*) " ( ( \_/ '-._\ ) ) " 248 WRITE(numout,*) " ) ) ` ( ( " 249 WRITE(numout,*) " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " 250 WRITE(numout,*) 251 ! 252 WRITE(numout,cform_aaa) ! Flag AAAAAAA 253 ! 254 ENDIF 255 ! 256 ! finalize the definition of namctl variables 230 257 IF( sn_cfctl%l_config ) THEN 231 258 ! Activate finer control of report outputs … … 239 266 CALL nemo_set_cfctl( sn_cfctl, ln_ctl, .TRUE. ) 240 267 ENDIF 241 242 lwm = (narea == 1) ! control of output namelists 243 lwp = (narea == 1) .OR. ln_ctl ! control of all listing output print 244 245 IF(lwm) THEN ! write merged namelists from earlier to output namelist 246 ! ! now that the file has been opened in call to mynode. 247 ! ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 248 WRITE( numond, namctl ) 249 WRITE( numond, namcfg ) 250 IF( .NOT.ln_read_cfg ) THEN 251 DO ji = 1, SIZE(clnam) 252 IF( TRIM(clnam(ji)) /= '' ) WRITE(numond, * ) clnam(ji) ! namusr_def print 253 END DO 254 ENDIF 255 ENDIF 256 257 IF(lwp) THEN ! open listing units 258 ! 259 CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 260 ! 261 WRITE(numout,*) 262 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' 263 WRITE(numout,*) ' NEMO team' 264 WRITE(numout,*) ' Off-line TOP Model' 265 WRITE(numout,*) ' NEMO version 4.0 (2019) ' 266 WRITE(numout,*) 267 WRITE(numout,*) " ._ ._ ._ ._ ._ " 268 WRITE(numout,*) " _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ " 269 WRITE(numout,*) 270 WRITE(numout,*) " o _, _, " 271 WRITE(numout,*) " o .' ( .-' / " 272 WRITE(numout,*) " o _/..._'. .' / " 273 WRITE(numout,*) " ( o .-'` ` '-./ _.' " 274 WRITE(numout,*) " ) ( o) ;= <_ ( " 275 WRITE(numout,*) " ( '-.,\\__ __.-;`\ '. ) " 276 WRITE(numout,*) " ) ) \) |`\ \) '. \ ( ( " 277 WRITE(numout,*) " ( ( \_/ '-._\ ) ) " 278 WRITE(numout,*) " ) ) ` ( ( " 279 WRITE(numout,*) " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " 280 WRITE(numout,*) 281 DO ji = 1, SIZE(cltxt) 282 IF( TRIM(cltxt (ji)) /= '' ) WRITE(numout,*) TRIM(cltxt(ji)) ! control print of mynode 283 END DO 284 WRITE(numout,*) 285 WRITE(numout,*) 286 DO ji = 1, SIZE(cltxt2) 287 IF( TRIM(cltxt2(ji)) /= '' ) WRITE(numout,*) TRIM(cltxt2(ji)) ! control print of domain size 288 END DO 289 ! 290 WRITE(numout,cform_aaa) ! Flag AAAAAAA 291 ! 292 ENDIF 293 ! open /dev/null file to be able to supress output write easily 294 CALL ctl_opn( numnul, '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 295 ! 296 ! ! Domain decomposition 297 CALL mpp_init ! MPP 268 ! 269 IF(lwm) WRITE( numond, namctl ) 270 ! 271 ! !------------------------------------! 272 ! ! Set global domain size parameters ! 273 ! !------------------------------------! 274 ! 275 REWIND( numnam_ref ) ! Namelist namcfg in reference namelist 276 READ ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 277 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist' ) 278 REWIND( numnam_cfg ) ! Namelist namcfg in confguration namelist 279 READ ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 280 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist' ) 281 ! 282 IF( ln_read_cfg ) THEN ! Read sizes in domain configuration file 283 CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 284 ELSE ! user-defined namelist 285 CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 286 ENDIF 287 ! 288 IF(lwm) WRITE( numond, namcfg ) 289 l_offline = .true. ! passive tracers are run offline 290 ! 291 ! !-----------------------------------------! 292 ! ! mpp parameters and domain decomposition ! 293 ! !-----------------------------------------! 294 ! 295 CALL mpp_init 298 296 299 297 ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays
Note: See TracChangeset
for help on using the changeset viewer.