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