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 7403 for branches/2016/dev_merge_2016/NEMOGCM/NEMO/TOP_SRC/trc.F90 – NEMO

Ignore:
Timestamp:
2016-11-30T17:56:53+01:00 (8 years ago)
Author:
timgraham
Message:

Merge dev_INGV_METO_merge_2016 into branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_merge_2016/NEMOGCM/NEMO/TOP_SRC/trc.F90

    r6140 r7403  
    2828   INTEGER, PUBLIC                                                 ::   numnat_cfg = -1   !: logical unit for the reference passive tracer namelist_top_cfg 
    2929   INTEGER, PUBLIC                                                 ::   numont     = -1   !: logical unit for the reference passive tracer namelist output output.namelist.top 
     30   INTEGER, PUBLIC                                                 ::   numtrc_ref = -1   !: logical unit for the reference passive tracer namelist_top_ref 
     31   INTEGER, PUBLIC                                                 ::   numtrc_cfg = -1   !: logical unit for the reference passive tracer namelist_top_cfg 
     32   INTEGER, PUBLIC                                                 ::   numonr     = -1   !: logical unit for the reference passive tracer namelist output output.namelist.top 
    3033   INTEGER, PUBLIC                                                 ::   numstr        !: logical unit for tracer statistics 
    3134   INTEGER, PUBLIC                                                 ::   numrtr        !: logical unit for trc restart (read ) 
     
    6871   CHARACTER(len = 256), PUBLIC                                    ::  cn_trcrst_outdir  !: restart output directory 
    6972   REAL(wp)            , PUBLIC                                    ::  rdttrc         !: passive tracer time step 
    70    LOGICAL             , PUBLIC                                    ::  ln_top_euler  !: boolean term for euler integration  
     73   REAL(wp)            , PUBLIC                                    ::  r2dttrc        !: = 2*rdttrc except at nit000 (=rdttrc) if neuler=0 
     74   LOGICAL             , PUBLIC                                    ::  ln_top_euler   !: boolean term for euler integration  
    7175   LOGICAL             , PUBLIC                                    ::  ln_trcdta      !: Read inputs data from files 
    7276   LOGICAL             , PUBLIC                                    ::  ln_trcdmp      !: internal damping flag 
    7377   LOGICAL             , PUBLIC                                    ::  ln_trcdmp_clo  !: internal damping flag on closed seas 
    74    INTEGER             , PUBLIC                                    ::  nittrc000       !: first time step of passive tracers model 
     78   INTEGER             , PUBLIC                                    ::  nittrc000      !: first time step of passive tracers model 
    7579   LOGICAL             , PUBLIC                                    ::  l_trcdm2dc     !: Diurnal cycle for TOP 
    7680 
     
    8387   END TYPE 
    8488 
    85    REAL(wp), DIMENSION(jptra), PUBLIC         :: trc_ice_ratio, & ! ice-ocean tracer ratio 
    86                                                  trc_ice_prescr   ! prescribed ice trc cc 
    87    CHARACTER(len=2), DIMENSION(jptra), PUBLIC :: cn_trc_o ! choice of ocean tracer cc 
     89   REAL(wp)        , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)  :: trc_ice_ratio      ! ice-ocean tracer ratio 
     90   REAL(wp)        , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)  :: trc_ice_prescr     ! prescribed ice trc cc 
     91   CHARACTER(len=2), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)  :: cn_trc_o ! choice of ocean tracer cc 
     92 
    8893 
    8994   !! information for outputs 
     
    9499       CHARACTER(len = 20)  :: clunit   !: unit 
    95100       LOGICAL              :: llinit   !: read in a file or not 
    96 #if defined  key_my_trc 
    97101       LOGICAL              :: llsbc   !: read in a file or not 
    98102       LOGICAL              :: llcbc   !: read in a file or not 
    99103       LOGICAL              :: llobc   !: read in a file or not 
    100 #endif 
    101        LOGICAL              :: llsave   !: save the tracer or not 
    102104   END TYPE PTRACER 
     105 
    103106   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcnm         !: tracer name  
    104107   CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcln         !: trccer field long name 
    105108   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcun         !: tracer unit 
    106    LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_wri     !: save the tracer or not 
    107109 
    108110   TYPE, PUBLIC :: DIAG                                                               !: passive trcacer ddditional diagnostic type 
     
    112114   END TYPE DIAG 
    113115 
     116   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trc3d          !: 3D diagnostics for tracers 
     117   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trc2d          !: 2D diagnostics for tracers 
     118 
    114119   !! information for inputs 
    115120   !! -------------------------------------------------- 
    116    LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_ini     !: Initialisation from data input file 
    117    LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_obc     !: Use open boundary condition data 
    118    LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_sbc     !: Use surface boundary condition data 
    119    LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_cbc     !: Use coastal boundary condition data 
    120  
    121    !! additional 2D/3D outputs namelist 
    122    !! -------------------------------------------------- 
    123    REAL(wp)           , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,  :) ::   trc2d         !: additional 2d outputs array  
    124    REAL(wp)           , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   trc3d         !: additional 3d outputs array  
    125    CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc2d        !: 2d field short name 
    126    CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc2l        !: 2d field long name 
    127    CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc2u        !: 2d field unit 
    128    CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc3d        !: 3d field short name 
    129    CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc3l        !: 3d field long name 
    130    CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::   ctrc3u        !: 3d field unit 
    131    LOGICAL            , PUBLIC                                        ::  ln_diatrc      !: boolean term for additional diagnostic 
    132    INTEGER            , PUBLIC                                        ::  nn_writedia    !: frequency of additional outputs 
    133  
    134    !! Biological trends 
    135    !! ----------------- 
    136    LOGICAL            , PUBLIC                                        ::  ln_diabio      !: boolean term for biological diagnostic 
    137    INTEGER            , PUBLIC                                        ::  nn_writebio    !: frequency of biological outputs 
    138    REAL(wp)           , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  trbio          !: biological trends 
    139    CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  ctrbio         !: bio field short name 
    140    CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  ctrbil         !: bio field long name 
    141    CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  ctrbiu         !: bio field unit 
     121   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_ini     !: Initialisation from data input file 
     122   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_obc     !: Use open boundary condition data 
     123   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_sbc     !: Use surface boundary condition data 
     124   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_cbc     !: Use coastal boundary condition data 
     125   LOGICAL , PUBLIC                                     ::  ln_rnf_ctl     !: remove runoff dilution on tracers 
     126   REAL(wp), PUBLIC                                     ::  rn_bc_time     !: Time scaling factor for SBC and CBC data (seconds in a day) 
     127 
    142128 
    143129   !! variables to average over physics over passive tracer sub-steps. 
     
    211197      USE lib_mpp, ONLY: ctl_warn 
    212198      !!------------------------------------------------------------------- 
     199      INTEGER :: ierr(3) 
     200      !!------------------------------------------------------------------- 
     201      ierr(:) = 0 
    213202      ! 
    214203      ALLOCATE( trn(jpi,jpj,jpk,jptra), trb(jpi,jpj,jpk,jptra), tra(jpi,jpj,jpk,jptra),       &   
     
    216205         &      gtru (jpi,jpj,jptra)  , gtrv (jpi,jpj,jptra)                          ,       & 
    217206         &      gtrui(jpi,jpj,jptra)  , gtrvi(jpi,jpj,jptra)                          ,       & 
     207         &      trc_ice_ratio(jptra)  , trc_ice_prescr(jptra) , cn_trc_o(jptra)       ,       & 
    218208         &      sbc_trc_b(jpi,jpj,jptra), sbc_trc(jpi,jpj,jptra)                      ,       &   
    219          &      cvol(jpi,jpj,jpk)     , trai(jptra)                                   ,       & 
    220          &      ctrcnm(jptra)         , ctrcln(jptra)         , ctrcun(jptra)         ,       &  
    221          &      ln_trc_ini(jptra)     , ln_trc_wri(jptra)     , qsr_mean(jpi,jpj)     ,       & 
    222 #if defined key_my_trc 
     209         &      cvol(jpi,jpj,jpk)     , trai(jptra)           , qsr_mean(jpi,jpj)     ,       & 
     210         &      ctrcnm(jptra)         , ctrcln(jptra)         , ctrcun(jptra)         ,       & 
     211         &      ln_trc_ini(jptra)     ,                                                       & 
    223212         &      ln_trc_sbc(jptra)     , ln_trc_cbc(jptra)     , ln_trc_obc(jptra)     ,       & 
    224 #endif 
    225213#if defined key_bdy 
    226214         &      cn_trc_dflt(nb_bdy)   , cn_trc(nb_bdy)        , nn_trcdmp_bdy(nb_bdy) ,       & 
    227215         &      trcdta_bdy(jptra,nb_bdy)                                              ,       & 
    228216#endif 
    229          &      STAT = trc_alloc  ) 
    230  
     217         &      STAT = ierr(1)  ) 
     218      ! 
     219      IF (jp_dia3d > 0 ) ALLOCATE( trc3d(jpi,jpj,jpk,jp_dia3d), STAT = ierr(2) ) 
     220      ! 
     221      IF (jp_dia2d > 0 ) ALLOCATE( trc2d(jpi,jpj,jpk,jp_dia2d), STAT = ierr(3) ) 
     222      !  
     223      trc_alloc = MAXVAL( ierr ) 
    231224      IF( trc_alloc /= 0 )   CALL ctl_warn('trc_alloc: failed to allocate arrays') 
    232225      ! 
Note: See TracChangeset for help on using the changeset viewer.