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 13576 for branches/UKMO/AMM15_v3_6_STABLE_package_collate/NEMOGCM/NEMO/TOP_SRC/FABM/trcnam_fabm.F90 – NEMO

Ignore:
Timestamp:
2020-10-09T12:35:11+02:00 (4 years ago)
Author:
dford
Message:

Update NEMO-FABM coupler for FABM v1, and introduce two-way NEMO-ERSEM coupling options. See https://code.metoffice.gov.uk/trac/utils/ticket/366.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/AMM15_v3_6_STABLE_package_collate/NEMOGCM/NEMO/TOP_SRC/FABM/trcnam_fabm.F90

    r10270 r13576  
    44   !! TOP :   initialisation of some run parameters for FABM bio-model 
    55   !!====================================================================== 
    6    !! History :   2.0  !  2007-12  (C. Ethe, G. Madec) Original code 
     6   !! History :   1.0  !  2015-04  (PML) Original code 
     7   !! History :   1.1  !  2020-06  (PML) Update to FABM 1.0, improved performance 
    78   !!---------------------------------------------------------------------- 
    89#if defined key_fabm 
     
    1819   USE par_fabm 
    1920   USE trcsms_fabm 
    20  
    2121 
    2222   IMPLICIT NONE 
     
    3535 
    3636   SUBROUTINE trc_nam_fabm 
     37      LOGICAL :: l_ext 
     38      INTEGER :: nmlunit, ios 
     39      NAMELIST/namfabm/ nn_adv 
     40 
     41      ! Read NEMO-FABM coupler settings from namfabm 
     42      nn_adv = 3 
     43      INQUIRE( FILE='namelist_fabm_ref', EXIST=l_ext ) 
     44      IF (l_ext) then 
     45         CALL ctl_opn( nmlunit, 'namelist_fabm_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE.) 
     46         READ(nmlunit, nml=namfabm, iostat=ios) 
     47         IF( ios /= 0 ) CALL ctl_nam ( ios , 'namfabm in namelist_fabm_ref', .TRUE. ) 
     48      END IF 
     49      INQUIRE( FILE='namelist_fabm_cfg', EXIST=l_ext ) 
     50      IF (l_ext) then 
     51         CALL ctl_opn( nmlunit, 'namelist_fabm_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE.) 
     52         READ(nmlunit, nml=namfabm, iostat=ios) 
     53         IF( ios /= 0 ) CALL ctl_nam ( ios , 'namfabm in namelist_fabm_cfg', .TRUE. ) 
     54      END IF 
     55      IF (nn_adv /= 1 .and. nn_adv /= 3) CALL ctl_stop( 'STOP', 'trc_ini_fabm: nn_adv must be 1 or 3.' ) 
    3756   END SUBROUTINE trc_nam_fabm 
    3857 
    39    SUBROUTINE trc_nam_fabm_override 
     58   SUBROUTINE trc_nam_fabm_override(sn_tracer) 
     59      TYPE(PTRACER), DIMENSION(jpmaxtrc), INTENT(INOUT) :: sn_tracer 
     60 
    4061      INTEGER :: jn 
     62      CHARACTER(LEN=3) :: index 
    4163 
    4264      DO jn=1,jp_fabm 
    43          ctrcnm(jp_fabm_m1+jn) = model%state_variables(jn)%name 
    44          ctrcln(jp_fabm_m1+jn) = model%state_variables(jn)%long_name 
    45          ctrcun(jp_fabm_m1+jn) = model%state_variables(jn)%units 
    46          ln_trc_ini(jp_fabm_m1+jn) = .FALSE. 
     65         IF (sn_tracer(jn)%clsname /= 'NONAME' .AND. sn_tracer(jn)%clsname /= model%interior_state_variables(jn)%name) THEN 
     66            WRITE (index,'(i0)') jn 
     67            CALL ctl_stop('Tracer name mismatch in namtrc: '//TRIM(sn_tracer(jn)%clsname)//' found at sn_tracer('//TRIM(index)//') where '//TRIM(model%interior_state_variables(jn)%name)//' was expected.') 
     68         END IF 
     69         sn_tracer(jn)%clsname = TRIM(model%interior_state_variables(jn)%name) 
     70         sn_tracer(jn)%cllname = TRIM(model%interior_state_variables(jn)%long_name) 
     71         sn_tracer(jn)%clunit = TRIM(model%interior_state_variables(jn)%units) 
     72         sn_tracer(jn)%llinit = .FALSE. 
    4773      END DO 
    4874   END SUBROUTINE trc_nam_fabm_override 
    49     
     75 
    5076#else 
    5177   !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.