- Timestamp:
- 2016-11-06T17:31:33+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
r7188 r7200 22 22 !! dom_nam : read and contral domain namelists 23 23 !! dom_ctl : control print for the ocean domain 24 !! cfg_write : create the "domain_cfg.nc" file containing all required configuration information 24 !! domain_cfg : read the global domain size in domain configuration file 25 !! cfg_write : create the domain configuration file 25 26 !!---------------------------------------------------------------------- 26 27 USE oce ! ocean variables … … 48 49 PRIVATE 49 50 50 PUBLIC dom_init ! called by opa.F90 51 PUBLIC dom_init ! called by nemogcm.F90 52 PUBLIC domain_cfg ! called by nemogcm.F90 51 53 52 54 !!------------------------------------------------------------------------- … … 110 112 END SELECT 111 113 WRITE(numout,*) ' Ocean model configuration used:' 112 WRITE(numout,*) ' c p_cfg = ', cp_cfg113 WRITE(numout,*) ' jp_cfg = ', jp_cfg114 WRITE(numout,*) ' cn_cfg = ', cn_cfg 115 WRITE(numout,*) ' nn_cfg = ', nn_cfg 114 116 ENDIF 115 117 ! … … 123 125 CALL dom_glo ! global domain versus local domain 124 126 CALL dom_nam ! read namelist ( namrun, namdom ) 125 CALL dom_clo( c p_cfg, jp_cfg ) ! Closed seas and lake127 CALL dom_clo( cn_cfg, nn_cfg ) ! Closed seas and lake 126 128 CALL dom_hgr ! Horizontal mesh 127 129 CALL dom_zgr( ik_top, ik_bot ) ! Vertical mesh and bathymetry … … 287 289 INTEGER :: ios ! Local integer output status for namelist read 288 290 !!---------------------------------------------------------------------- 289 291 ! 290 292 REWIND( numnam_ref ) ! Namelist namrun in reference namelist : Parameters of the run 291 293 READ ( numnam_ref, namrun, IOSTAT = ios, ERR = 901) 292 294 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namrun in reference namelist', lwp ) 293 295 ! 294 296 REWIND( numnam_cfg ) ! Namelist namrun in configuration namelist : Parameters of the run 295 297 READ ( numnam_cfg, namrun, IOSTAT = ios, ERR = 902 ) … … 380 382 READ ( numnam_ref, namdom, IOSTAT = ios, ERR = 903) 381 383 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdom in reference namelist', lwp ) 382 383 384 ! 384 385 REWIND( numnam_cfg ) ! Namelist namdom in configuration namelist : space & time domain (bathymetry, mesh, timestep) … … 414 415 READ ( numnam_ref, namnc4, IOSTAT = ios, ERR = 907) 415 416 907 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namnc4 in reference namelist', lwp ) 416 417 ! 417 418 REWIND( numnam_cfg ) ! Namelist namnc4 in configuration namelist : NETCDF 418 419 READ ( numnam_cfg, namnc4, IOSTAT = ios, ERR = 908 ) … … 492 493 493 494 495 SUBROUTINE domain_cfg( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 496 !!---------------------------------------------------------------------- 497 !! *** ROUTINE dom_nam *** 498 !! 499 !! ** Purpose : read the domain size in domain configuration file 500 !! 501 !! ** Method : 502 !! 503 !!---------------------------------------------------------------------- 504 CHARACTER(len=*), DIMENSION(:), INTENT(out) :: ldtxt, ldnam ! stored print information 505 CHARACTER(len=*) , INTENT(out) :: cd_cfg ! configuration name 506 INTEGER , INTENT(out) :: kk_cfg ! configuration resolution 507 INTEGER , INTENT(out) :: kpi, kpj, kpk ! global domain sizes 508 INTEGER , INTENT(out) :: kperio ! lateral global domain b.c. 509 ! 510 INTEGER :: inum, ii ! local integer 511 REAL(wp) :: zorca_res ! local scalars 512 REAL(wp) :: ziglo, zjglo, zkglo, zperio ! - - 513 !!---------------------------------------------------------------------- 514 ! 515 ii = 1 516 WRITE(ldtxt(ii),*) ' ' ; ii = ii+1 517 WRITE(ldtxt(ii),*) 'domain_cfg : domain size read in', TRIM( cn_domcfg ), ' file' ; ii = ii+1 518 WRITE(ldtxt(ii),*) '~~~~~~~~~~ ' ; ii = ii+1 519 ! 520 CALL iom_open( cn_domcfg, inum ) 521 ! 522 ! !- ORCA family specificity 523 IF( iom_varid( inum, 'ORCA' , ldstop = .FALSE. ) > 0 .AND. & 524 & iom_varid( inum, 'ORCA_resolution', ldstop = .FALSE. ) > 0 ) THEN 525 ! 526 cd_cfg = 'ORCA' 527 CALL iom_get( inum, 'ORCA_resolution', zorca_res ) ; kk_cfg = INT( zorca_res ) 528 ! 529 WRITE(ldtxt(ii),*) ' ' ; ii = ii+1 530 WRITE(ldtxt(ii),*) ' ==>>> ORCA configuration ' ; ii = ii+1 531 WRITE(ldtxt(ii),*) ' ' ; ii = ii+1 532 ! 533 ELSE !- cd_cfg & k_cfg are not used 534 cd_cfg = 'UNKNOWN' 535 kk_cfg = -9999999 536 ENDIF 537 ! 538 CALL iom_get( inum, 'jpiglo', ziglo ) ; jpiglo = INT( ziglo ) 539 CALL iom_get( inum, 'jpjglo', zjglo ) ; jpjglo = INT( zjglo ) 540 CALL iom_get( inum, 'jpkglo', zkglo ) ; jpkglo = INT( zkglo ) 541 CALL iom_get( inum, 'jperio', zperio ) ; jperio = INT( zperio ) 542 CALL iom_close( inum ) 543 ! 544 WRITE(ldtxt(ii),*) ' cn_cfg = ', TRIM(cd_cfg), ' nn_cfg = ', kk_cfg ; ii = ii+1 545 WRITE(ldtxt(ii),*) ' jpiglo = ', jpiglo ; ii = ii+1 546 WRITE(ldtxt(ii),*) ' jpjglo = ', jpjglo , ' jpkglo = ', jpkglo ; ii = ii +1 547 WRITE(ldtxt(ii),*) ' jpkglo = ', jpkglo ; ii = ii +1 548 WRITE(ldtxt(ii),*) ' type of global domain lateral boundary jperio = ', jperio ; ii = ii +1 549 ! 550 END SUBROUTINE domain_cfg 551 552 494 553 SUBROUTINE cfg_write 495 554 !!---------------------------------------------------------------------- 496 555 !! *** ROUTINE cfg_write *** 497 556 !! 498 !! ** Purpose : Create the " domain_cfg" file, a NetCDF file which557 !! ** Purpose : Create the "cn_domcfg_out" file, a NetCDF file which 499 558 !! contains all the ocean domain informations required to 500 559 !! define an ocean configuration. … … 503 562 !! ocean configuration. 504 563 !! 505 !! ** output file : domain_cfg.nc : domain size, characteristics, horizontal mesh, 506 !! Coriolis parameter, depth and vertical scale factors 564 !! ** output file : domcfg_out.nc : domain size, characteristics, horizontal 565 !! mesh, Coriolis parameter, and vertical scale factors 566 !! NB: also contain ORCA family information 507 567 !!---------------------------------------------------------------------- 508 568 INTEGER :: ji, jj, jk ! dummy loop indices 509 569 INTEGER :: izco, izps, isco, icav 510 INTEGER :: inum ! temprary units for 'domain_cfg.nc' file570 INTEGER :: inum ! local units 511 571 CHARACTER(len=21) :: clnam ! filename (mesh and mask informations) 512 572 REAL(wp), DIMENSION(jpi,jpj) :: z2d ! workspace … … 514 574 ! 515 575 IF(lwp) WRITE(numout,*) 516 IF(lwp) WRITE(numout,*) 'cfg_write : create the "domain_cfg.nc" file containing all required configuration information'576 IF(lwp) WRITE(numout,*) 'cfg_write : create the domain configuration file (', TRIM(cn_domcfg_out),'.nc)' 517 577 IF(lwp) WRITE(numout,*) '~~~~~~~~~' 518 578 ! 519 579 ! ! ============================= ! 520 ! ! create 'dom ain_cfg.nc' file !580 ! ! create 'domcfg_out.nc' file ! 521 581 ! ! ============================= ! 522 582 ! 523 clnam = 'dom ain_cfg' ! filename (configuration information)583 clnam = 'domcfg_out' ! filename (configuration information) 524 584 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE., kiolib = jprstlib ) 525 585 586 ! 587 ! !== ORCA family specificities ==! 588 IF( cn_cfg == "ORCA" ) THEN 589 CALL iom_rstput( 0, 0, inum, 'ORCA' , 1._wp , ktype = jp_i4 ) 590 CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( nn_cfg, wp), ktype = jp_i4 ) 591 ENDIF 592 ! 526 593 ! !== global domain size ==! 527 594 ! … … 574 641 ! !== vertical mesh ==! 575 642 ! 576 CALL iom_rstput( 0, 0, inum, 'e3t_1d' , e3t_1d 577 CALL iom_rstput( 0, 0, inum, 'e3w_1d' , e3w_1d 578 ! 579 CALL iom_rstput( 0, 0, inum, 'e3t_0' , e3t_0 580 CALL iom_rstput( 0, 0, inum, 'e3u_0' , e3u_0 581 CALL iom_rstput( 0, 0, inum, 'e3v_0' , e3v_0 582 CALL iom_rstput( 0, 0, inum, 'e3f_0' , e3f_0 583 CALL iom_rstput( 0, 0, inum, 'e3w_0' , e3w_0 584 CALL iom_rstput( 0, 0, inum, 'e3uw_0' , e3uw_0 585 CALL iom_rstput( 0, 0, inum, 'e3vw_0' , e3vw_0 643 CALL iom_rstput( 0, 0, inum, 'e3t_1d' , e3t_1d , ktype = jp_r8 ) ! reference 1D-coordinate 644 CALL iom_rstput( 0, 0, inum, 'e3w_1d' , e3w_1d , ktype = jp_r8 ) 645 ! 646 CALL iom_rstput( 0, 0, inum, 'e3t_0' , e3t_0 , ktype = jp_r8 ) ! vertical scale factors 647 CALL iom_rstput( 0, 0, inum, 'e3u_0' , e3u_0 , ktype = jp_r8 ) 648 CALL iom_rstput( 0, 0, inum, 'e3v_0' , e3v_0 , ktype = jp_r8 ) 649 CALL iom_rstput( 0, 0, inum, 'e3f_0' , e3f_0 , ktype = jp_r8 ) 650 CALL iom_rstput( 0, 0, inum, 'e3w_0' , e3w_0 , ktype = jp_r8 ) 651 CALL iom_rstput( 0, 0, inum, 'e3uw_0' , e3uw_0 , ktype = jp_r8 ) 652 CALL iom_rstput( 0, 0, inum, 'e3vw_0' , e3vw_0 , ktype = jp_r8 ) 586 653 ! 587 654 ! !== wet top and bottom level ==! (caution: multiplied by ssmask)
Note: See TracChangeset
for help on using the changeset viewer.