Ignore:
Timestamp:
2020-07-03T14:42:49+02:00 (3 months ago)
Author:
dford
Message:

Update NEMO-FABM coupler for compatability with FABM v1.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/AMM15_v3_6_STABLE_package_collate_utils366_fabmv1/NEMOGCM/NEMO/TOP_SRC/FABM/inputs_fabm.F90

    r10158 r13241  
    1919   USE fldread 
    2020   USE par_fabm 
    21    USE fabm 
     21   USE fabm, only: type_fabm_horizontal_variable_id 
    2222 
    2323   IMPLICIT NONE 
     24 
     25#  include "vectopt_loop_substitute.h90" 
    2426 
    2527   PRIVATE 
     
    4042 
    4143   TYPE, PUBLIC, EXTENDS(type_input_variable) :: type_input_data 
    42       TYPE(type_horizontal_variable_id)  :: horizontal_id 
    43       TYPE(type_input_data), POINTER   :: next => null() 
     44      TYPE(type_fabm_horizontal_variable_id) :: horizontal_id 
     45      TYPE(type_input_data), POINTER         :: next => null() 
    4446   END TYPE 
    4547   TYPE (type_input_data), POINTER, PUBLIC :: first_input_data => NULL() 
     
    8789           ALLOCATE(input_data, STAT=ierr) 
    8890           IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'inputs_fabm:initialize_inputs: unable to allocate input_data object for variable '//TRIM(name) ) 
    89            input_data%horizontal_id = fabm_get_horizontal_variable_id(model,name) 
    90            IF (.NOT.fabm_is_variable_used(input_data%horizontal_id)) THEN 
     91           input_data%horizontal_id = model%get_horizontal_variable_id(name) 
     92           IF (.NOT.model%is_variable_used(input_data%horizontal_id)) THEN 
    9193              ! This variable was not found among FABM's horizontal variables (at least, those that are read by one or more FABM modules) 
    9294              CALL ctl_stop('STOP', 'inputs_fabm:initialize_inputs: variable "'//TRIM(name)//'" was not found among horizontal FABM variables.') 
     
    130132           ! within tracer field 
    131133           DO jn=1,jp_fabm 
    132              IF (TRIM(name) == TRIM(model%state_variables(jn)%name)) THEN 
     134             IF (TRIM(name) == TRIM(model%interior_state_variables(jn)%name)) THEN 
    133135               river_data%jp_pos = jp_fabm_m1+jn 
    134136             END IF 
     
    173175         ! Provide FABM with pointer to field that will receive prescribed data. 
    174176         ! NB source=data_source_user guarantees that the prescribed data takes priority over any data FABM may already have for that variable. 
    175          CALL fabm_link_horizontal_data(model,input_data%horizontal_id,input_data%sf(1)%fnow(:,:,1),source=data_source_user) 
     177         CALL model%link_horizontal_data(input_data%horizontal_id,input_data%sf(1)%fnow(:,:,1),source=data_source_user) 
    176178         input_data => input_data%next 
    177179      END DO 
     
    226228#endif 
    227229        IF( kt == nit000 .OR. ( kt /= nit000 ) ) THEN 
    228             DO jj = 1, jpj 
    229               DO ji = 1, jpi 
     230            DO jj = 2, jpjm1 
     231              DO ji = fs_2, fs_jpim1 
    230232                ! convert units and divide by surface area 
    231233                ! loading / cell volume * vertical fraction of riverload 
Note: See TracChangeset for help on using the changeset viewer.