New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 6827 for branches/2016/dev_r6409_SIMPLIF_2_usrdef_tools/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2016-08-01T15:37:15+02:00 (8 years ago)
Author:
flavoni
Message:

#1692 - branch SIMPLIF_2_usrdef: commit routines Fortran to create domain_cfg.nc file, to have domain (input) files for new simplification branch. To be moved in TOOLS directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef_tools/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r6152 r6827  
    4848   USE mppini         ! shared/distributed memory setting (mpp_init routine) 
    4949   USE domain         ! domain initialization             (dom_init routine) 
    50 #if defined key_nemocice_decomp 
    51    USE ice_domain_size, only: nx_global, ny_global 
    52 #endif 
    53    USE tideini        ! tidal components initialization   (tide_ini routine) 
    54    USE bdyini         ! open boundary cond. setting       (bdy_init routine) 
    55    USE bdydta         ! open boundary cond. setting   (bdy_dta_init routine) 
    56    USE bdytides       ! open boundary cond. setting   (bdytide_init routine) 
    57    USE sbctide, ONLY  : lk_tide 
    58    USE istate         ! initial state setting          (istate_init routine) 
    59    USE ldfdyn         ! lateral viscosity setting      (ldfdyn_init routine) 
    60    USE ldftra         ! lateral diffusivity setting    (ldftra_init routine) 
    61    USE zdfini         ! vertical physics setting          (zdf_init routine) 
    6250   USE phycst         ! physical constant                  (par_cst routine) 
    63    USE trdini         ! dyn/tra trends initialization     (trd_init routine) 
    64    USE asminc         ! assimilation increments      
    65    USE asmbkg         ! writing out state trajectory 
    66    USE diaptr         ! poleward transports           (dia_ptr_init routine) 
    67    USE diadct         ! sections transports           (dia_dct_init routine) 
    68    USE diaobs         ! Observation diagnostics       (dia_obs_init routine) 
    69    USE diacfl         ! CFL diagnostics               (dia_cfl_init routine) 
    7051   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    71    USE step           ! NEMO time-stepping                 (stp     routine) 
    72    USE icbini         ! handle bergs, initialisation 
    73    USE icbstp         ! handle bergs, calving, themodynamics and transport 
    74    USE cpl_oasis3     ! OASIS3 coupling 
    75    USE c1d            ! 1D configuration 
    76    USE step_c1d       ! Time stepping loop for the 1D configuration 
    77    USE dyndmp         ! Momentum damping 
    78    USE stopar         ! Stochastic param.: ??? 
    79    USE stopts         ! Stochastic param.: ??? 
    80 #if defined key_top 
    81    USE trcini         ! passive tracer initialisation 
    82 #endif 
    8352   USE lib_mpp        ! distributed memory computing 
    84    USE diurnal_bulk    ! diurnal bulk SST  
    85    USE step_diu        ! diurnal bulk SST timestepping (called from here if run offline) 
    8653#if defined key_iomput 
    8754   USE xios           ! xIOserver 
    8855#endif 
    89    USE crsini         ! initialise grid coarsening utility 
    9056   USE lbcnfd , ONLY  : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges  
    91    USE sbc_oce, ONLY  : lk_oasis 
    92    USE diatmb          ! Top,middle,bottom output 
    93    USE dia25h          ! 25h mean output 
    94    USE wet_dry         ! Wetting and drying setting   (wad_init routine) 
    9557 
    9658   IMPLICIT NONE 
     
    13799      CALL Agrif_Declare_Var_dom   ! AGRIF: set the meshes for DOM 
    138100      CALL Agrif_Declare_Var       !  "      "   "   "      "  DYN/TRA  
    139 # if defined key_top 
    140       CALL Agrif_Declare_Var_top   !  "      "   "   "      "  TOP 
    141 # endif 
    142 # if defined key_lim2 
    143       CALL Agrif_Declare_Var_lim2  !  "      "   "   "      "  LIM 
    144 # endif 
    145101#endif 
    146102      ! check that all process are still there... If some process have an error, 
     
    151107 
    152108      !                            !-----------------------! 
    153       !                            !==   time stepping   ==! 
    154       !                            !-----------------------! 
    155       istp = nit000 
    156 #if defined key_c1d 
    157          DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    158             CALL stp_c1d( istp ) 
    159             istp = istp + 1 
    160          END DO 
    161 #else 
    162           IF( lk_asminc ) THEN 
    163              IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 )    ! Output background fields 
    164              IF( ln_asmdin ) THEN                        ! Direct initialization 
    165                 IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 )    ! Tracers 
    166                 IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 )    ! Dynamics 
    167                 IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 )    ! SSH 
    168              ENDIF 
    169           ENDIF 
    170  
    171 #if defined key_agrif 
    172           CALL Agrif_Regrid() 
    173 #endif 
    174  
    175          DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    176 #if defined key_agrif 
    177             CALL stp                         ! AGRIF: time stepping 
    178 #else 
    179             IF ( .NOT. ln_diurnal_only ) THEN  
    180                CALL stp( istp )                 ! standard time stepping  
    181             ELSE  
    182                CALL stp_diurnal( istp )        ! time step only the diurnal SST  
    183             ENDIF  
    184 #endif 
    185             istp = istp + 1 
    186             IF( lk_mpp )   CALL mpp_max( nstop ) 
    187          END DO 
    188 #endif 
    189  
    190       IF( ln_diaobs   )   CALL dia_obs_wri 
    191       ! 
    192       IF( ln_icebergs )   CALL icb_end( nitend ) 
    193  
    194       !                            !------------------------! 
    195109      !                            !==  finalize the run  ==! 
    196110      !                            !------------------------! 
    197       IF(lwp) WRITE(numout,cform_aaa)   ! Flag AAAAAAA 
    198111      ! 
    199112      IF( nstop /= 0 .AND. lwp ) THEN   ! error print 
     
    204117#if defined key_agrif 
    205118      IF( .NOT. Agrif_Root() ) THEN 
    206                          CALL Agrif_ParentGrid_To_ChildGrid() 
    207          IF( ln_diaobs ) CALL dia_obs_wri 
     119                                CALL Agrif_ParentGrid_To_ChildGrid() 
    208120         IF( nn_timing == 1 )   CALL timing_finalize 
    209121                                CALL Agrif_ChildGrid_To_ParentGrid() 
     
    216128#if defined key_iomput 
    217129      CALL xios_finalize                  ! end mpp communications with xios 
    218       IF( lk_oasis )   CALL cpl_finalize  ! end coupling and mpp communications with OASIS 
    219130#else 
    220       IF( lk_oasis ) THEN  
    221          CALL cpl_finalize              ! end coupling and mpp communications with OASIS 
    222       ELSE 
    223          IF( lk_mpp )   CALL mppstop    ! end mpp communications 
    224       ENDIF 
     131      IF( lk_mpp )   CALL mppstop    ! end mpp communications 
    225132#endif 
    226133      ! 
     
    294201#if defined key_iomput 
    295202      IF( Agrif_Root() ) THEN 
    296          IF( lk_oasis ) THEN 
    297             CALL cpl_init( "oceanx", ilocal_comm )                     ! nemo local communicator given by oasis 
    298             CALL xios_initialize( "not used",local_comm=ilocal_comm )    ! send nemo communicator to xios 
    299          ELSE 
    300203            CALL  xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm )    ! nemo local communicator given by xios 
    301          ENDIF 
    302204      ENDIF 
    303205      ! Nodes selection (control print return in cltxt) 
    304206      narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) 
    305207#else 
    306       IF( lk_oasis ) THEN 
    307          IF( Agrif_Root() ) THEN 
    308             CALL cpl_init( "oceanx", ilocal_comm )                      ! nemo local communicator given by oasis 
    309          ENDIF 
    310          ! Nodes selection (control print return in cltxt) 
    311          narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) 
    312       ELSE 
    313208         ilocal_comm = 0 
    314209         ! Nodes selection (control print return in cltxt) 
    315210         narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop ) 
    316       ENDIF 
    317211#endif 
    318212      narea = narea + 1                                     ! mynode return the rank of proc (0 --> jpnij -1 ) 
     
    402296                            CALL     phy_cst    ! Physical constants 
    403297                            CALL     eos_init   ! Equation of state 
    404       IF( lk_c1d        )   CALL     c1d_init   ! 1D column configuration 
    405                             CALL     wad_init   ! Wetting and drying options 
    406298                            CALL     dom_cfg    ! Domain configuration 
    407299                            CALL     dom_init   ! Domain 
    408       IF( ln_crs        )   CALL     crs_init   ! coarsened grid: domain initialization  
    409       IF( ln_nnogather )    CALL nemo_northcomms! northfold neighbour lists (must be done after the masks are defined) 
    410300      IF( ln_ctl        )   CALL prt_ctl_init   ! Print control 
    411        
    412       CALL diurnal_sst_bulk_init            ! diurnal sst 
    413       IF ( ln_diurnal ) CALL diurnal_sst_coolskin_init   ! cool skin    
    414        
    415       ! IF ln_diurnal_only, then we only want a subset of the initialisation routines 
    416       IF ( ln_diurnal_only ) THEN 
    417          CALL  istate_init   ! ocean initial state (Dynamics and tracers) 
    418          CALL     sbc_init   ! Forcings : surface module 
    419          CALL tra_qsr_init   ! penetrative solar radiation qsr 
    420          IF( ln_diaobs     ) THEN                  ! Observation & model comparison 
    421             CALL dia_obs_init            ! Initialize observational data 
    422             CALL dia_obs( nit000 - 1 )   ! Observation operator for restart 
    423          ENDIF      
    424          !                                     ! Assimilation increments 
    425          IF( lk_asminc     )   CALL asm_inc_init   ! Initialize assimilation increments 
    426                   
    427          IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
    428          RETURN 
    429       ENDIF 
    430        
    431                             CALL  istate_init   ! ocean initial state (Dynamics and tracers) 
    432  
    433       !                                      ! external forcing  
    434 !!gm to be added : creation and call of sbc_apr_init 
    435       IF( lk_tide       )   CALL    tide_init   ! tidal harmonics 
    436                             CALL     sbc_init   ! surface boundary conditions (including sea-ice) 
    437 !!gm ==>> bdy_init should call bdy_dta_init and bdytide_init  NOT in nemogcm !!! 
    438       IF( lk_bdy        )   CALL     bdy_init   ! Open boundaries initialisation 
    439       IF( lk_bdy        )   CALL bdy_dta_init   ! Open boundaries initialisation of external data arrays 
    440       IF( lk_bdy .AND. lk_tide )   & 
    441          &                  CALL bdytide_init   ! Open boundaries initialisation of tidal harmonic forcing 
    442           
    443       !                                      ! Ocean physics 
    444       !                                         ! Vertical physics 
    445                             CALL     zdf_init      ! namelist read 
    446                             CALL zdf_bfr_init      ! bottom friction 
    447       IF( lk_zdfric     )   CALL zdf_ric_init      ! Richardson number dependent Kz 
    448       IF( lk_zdftke     )   CALL zdf_tke_init      ! TKE closure scheme 
    449       IF( lk_zdfgls     )   CALL zdf_gls_init      ! GLS closure scheme 
    450       IF( lk_zdftmx     )   CALL zdf_tmx_init      ! tidal vertical mixing 
    451       IF( lk_zdfddm     )   CALL zdf_ddm_init      ! double diffusive mixing 
    452           
    453       !                                         ! Lateral physics 
    454                             CALL ldf_tra_init      ! Lateral ocean tracer physics 
    455                             CALL ldf_eiv_init      ! eddy induced velocity param. 
    456                             CALL ldf_dyn_init      ! Lateral ocean momentum physics 
    457  
    458       !                                         ! Active tracers 
    459                             CALL tra_qsr_init      ! penetrative solar radiation qsr 
    460                             CALL tra_bbc_init      ! bottom heat flux 
    461       IF( lk_trabbl     )   CALL tra_bbl_init      ! advective (and/or diffusive) bottom boundary layer scheme 
    462                             CALL tra_dmp_init      ! internal tracer damping 
    463                             CALL tra_adv_init      ! horizontal & vertical advection 
    464                             CALL tra_ldf_init      ! lateral mixing 
    465                             CALL tra_zdf_init      ! vertical mixing and after tracer fields 
    466  
    467       !                                         ! Dynamics 
    468       IF( lk_c1d        )   CALL dyn_dmp_init      ! internal momentum damping 
    469                             CALL dyn_adv_init      ! advection (vector or flux form) 
    470                             CALL dyn_vor_init      ! vorticity term including Coriolis 
    471                             CALL dyn_ldf_init      ! lateral mixing 
    472                             CALL dyn_hpg_init      ! horizontal gradient of Hydrostatic pressure 
    473                             CALL dyn_zdf_init      ! vertical diffusion 
    474                             CALL dyn_spg_init      ! surface pressure gradient 
    475  
    476 #if defined key_top 
    477       !                                      ! Passive tracers 
    478                             CALL     trc_init 
    479 #endif 
    480       IF( l_ldfslp      )   CALL ldf_slp_init   ! slope of lateral mixing 
    481  
    482       !                                      ! Icebergs 
    483                             CALL icb_init( rdt, nit000)   ! initialise icebergs instance 
    484  
    485       !                                      ! Misc. options 
    486                             CALL sto_par_init   ! Stochastic parametrization 
    487       IF( ln_sto_eos     )  CALL sto_pts_init   ! RRandom T/S fluctuations 
    488       
    489       !                                      ! Diagnostics 
    490       IF( lk_floats     )   CALL     flo_init   ! drifting Floats 
    491                             CALL dia_cfl_init   ! Initialise CFL diagnostics 
    492       IF( lk_diaar5     )   CALL dia_ar5_init   ! ar5 diag 
    493                             CALL dia_ptr_init   ! Poleward TRansports initialization 
    494       IF( lk_diadct     )   CALL dia_dct_init   ! Sections tranports 
    495                             CALL dia_hsb_init   ! heat content, salt content and volume budgets 
    496                             CALL     trd_init   ! Mixed-layer/Vorticity/Integral constraints trends 
    497                             CALL dia_obs_init            ! Initialize observational data 
    498       IF( ln_diaobs     )   CALL dia_obs( nit000 - 1 )   ! Observation operator for restart 
    499  
    500       !                                         ! Assimilation increments 
    501       IF( lk_asminc     )   CALL asm_inc_init   ! Initialize assimilation increments 
    502       IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
    503                             CALL dia_tmb_init  ! TMB outputs 
    504                             CALL dia_25h_init  ! 25h mean  outputs 
    505  
    506301      ! 
    507302   END SUBROUTINE nemo_init 
     
    600395      ENDIF 
    601396      ! 
    602       IF( nbench == 1 ) THEN              ! Benchmark 
    603          SELECT CASE ( cp_cfg ) 
    604          CASE ( 'gyre' )   ;   CALL ctl_warn( ' The Benchmark is activated ' ) 
    605          CASE DEFAULT      ;   CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:',   & 
    606             &                                 ' cp_cfg = "gyre" in namelist &namcfg or set nbench = 0' ) 
    607          END SELECT 
    608       ENDIF 
    609       ! 
    610397      IF( 1_wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ',  & 
    611398         &                                               'f2003 standard. '                              ,  & 
     
    653440      !! ** Method  : 
    654441      !!---------------------------------------------------------------------- 
    655       USE diawri    , ONLY: dia_wri_alloc 
    656442      USE dom_oce   , ONLY: dom_oce_alloc 
    657       USE trc_oce   , ONLY: trc_oce_alloc 
    658 #if defined key_diadct  
    659       USE diadct    , ONLY: diadct_alloc  
    660 #endif  
    661 #if defined key_bdy 
    662       USE bdy_oce   , ONLY: bdy_oce_alloc 
    663 #endif 
    664443      ! 
    665444      INTEGER :: ierr 
     
    667446      ! 
    668447      ierr =        oce_alloc       ()          ! ocean 
    669       ierr = ierr + dia_wri_alloc   () 
    670448      ierr = ierr + dom_oce_alloc   ()          ! ocean domain 
    671       ierr = ierr + zdf_oce_alloc   ()          ! ocean vertical physics 
    672       ! 
    673       ierr = ierr + trc_oce_alloc   ()          ! shared TRC / TRA arrays 
    674       ! 
    675 #if defined key_diadct  
    676       ierr = ierr + diadct_alloc    ()          !  
    677 #endif  
    678 #if defined key_bdy 
    679       ierr = ierr + bdy_oce_alloc   ()          ! bdy masks (incl. initialization) 
    680 #endif 
    681449      ! 
    682450      IF( lk_mpp    )   CALL mpp_sum( ierr ) 
Note: See TracChangeset for help on using the changeset viewer.