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 6681 for branches/UKMO/dev_r5518_GSI7_GSI8_landice_bitcomp_medusa/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90 – NEMO

Ignore:
Timestamp:
2016-06-10T12:26:35+02:00 (8 years ago)
Author:
frrh
Message:

Add changes for compatibility with main MEDUSA branch and to enable
coupling of true DMS, CO2 flux, CO2 from atmos and Dust from atmos.

This places responsibility for populating outgoing arrays and
employing incoming arrays on the MEDUSA branch rather than the
coupling interface branch.

NOTE: This revision contains a temporary fix for testing
to ensure coupling fields are initialised in the absence of
a clear mechanism for obtaining initial start-up values. Remove
the lines labelled RSRH in oce.F90 when this is resolved in the
MEDUSA code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GSI7_GSI8_landice_bitcomp_medusa/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r6670 r6681  
    3333   USE cpl_oasis3      ! OASIS3 coupling 
    3434   USE geo2ocean       !  
    35    USE oce   , ONLY : tsn, un, vn, sshn, ub, vb, sshb, fraqsr_1lev 
     35   USE oce   , ONLY : tsn, un, vn, sshn, ub, vb, sshb, fraqsr_1lev,            & 
     36                      CO2Flux_out_cpl, DMS_out_cpl, PCO2a_in_cpl, Dust_in_cpl, & 
     37                      ln_medusa 
    3638   USE albedo          ! 
    3739   USE in_out_manager  ! I/O manager 
     
    527529      srcv(jpr_atm_pco2)%clname = 'OATMPCO2' 
    528530 
    529       IF (TRIM(sn_rcv_atm_pco2%cldes) == 'coupled') THEN 
     531      IF (TRIM(sn_rcv_atm_pco2%cldes) == 'medusa') THEN 
    530532        srcv(jpr_atm_pco2)%laction = .TRUE. 
    531533      END IF 
    532534                
    533535      srcv(jpr_atm_dust)%clname = 'OATMDUST'    
    534       IF (TRIM(sn_rcv_atm_dust%cldes) == 'coupled')  THEN 
     536      IF (TRIM(sn_rcv_atm_dust%cldes) == 'medusa')  THEN 
    535537        srcv(jpr_atm_dust)%laction = .TRUE. 
    536538      END IF 
     
    812814      ssnd(jps_co2)%clname = 'O_CO2FLX' ;  IF( TRIM(sn_snd_co2%cldes) == 'coupled' )    ssnd(jps_co2 )%laction = .TRUE. 
    813815      ! 
     816 
     817      !                                                      ! ------------------------- ! 
     818      !                                                      !   MEDUSA output fields    ! 
     819      !                                                      ! ------------------------- ! 
     820      ssnd(jps_co2)%clname = 'O_CO2FLX'  
     821      ssnd(jps_bio_dms)%clname = 'OBioDMS'    
     822      IF( TRIM(sn_snd_bio_dms%cldes) == 'medusa' )    ssnd(jps_bio_dms )%laction = .TRUE. 
     823 
     824      ssnd(jps_bio_co2)%clname = 'OBioCO2'    
     825      IF( TRIM(sn_snd_bio_co2%cldes) == 'medusa' )    ssnd(jps_bio_co2 )%laction = .TRUE. 
    814826       
    815827      !                                                      ! ------------------------- ! 
     
    11761188      ENDIF 
    11771189 
    1178 #if defined key_medusa 
    1179       ! RSRH Allocate temporary arrays to receive incoming fields during testing 
    1180       ALLOCATE(atm_pco2(jpi,jpj)) 
    1181       ALLOCATE(atm_dust(jpi,jpj)) 
    1182  
    1183       IF( srcv(jpr_atm_pco2)%laction) atm_pco2(:,:) = frcv(jpr_atm_pco2)%z3(:,:,1) 
    1184       IF( srcv(jpr_atm_dust)%laction) atm_dust(:,:) = frcv(jpr_atm_dust)%z3(:,:,1) 
    1185       
    1186       ! RSRH Deallocate temporary arrays. 
    1187       DEALLOCATE(atm_pco2) 
    1188       DEALLOCATE(atm_dust) 
    1189 #endif 
     1190      IF (ln_medusa) THEN 
     1191        IF( srcv(jpr_atm_pco2)%laction) PCO2a_in_cpl(:,:) = frcv(jpr_atm_pco2)%z3(:,:,1) 
     1192        IF( srcv(jpr_atm_dust)%laction) Dust_in_cpl(:,:) = frcv(jpr_atm_dust)%z3(:,:,1) 
     1193      ENDIF 
    11901194 
    11911195#if defined key_cpl_carbon_cycle 
     
    22312235 
    22322236 
    2233 #if defined key_medusa 
    2234       IF( ssnd(jps_bio_co2)%laction ) CALL cpl_snd( jps_bio_co2, isec, RESHAPE( f_co2flux2d, (/jpi,jpj,1/) ), info ) 
    2235  
    2236       IF( ssnd(jps_bio_dms)%laction )  THEN 
    2237           ! We need to multiply DMS by a conversion factor to get values in the standard units expected in 
    2238           ! the coupling space. 
    2239           ztmp1(:,: ) = dms_surf2d(:,:) * dms_unit_conv 
    2240          CALL cpl_snd( jps_bio_dms, isec, RESHAPE( ztmp1, (/jpi,jpj,1/) ), info ) 
    2241       ENDIF 
    2242 #endif 
     2237      IF (ln_medusa) THEN 
     2238      !                                                      ! --------------------------------- ! 
     2239      !                                                      !  CO2 flux and DMS from MEDUSA     !  
     2240      !                                                      ! --------------------------------- ! 
     2241         IF ( ssnd(jps_bio_co2)%laction ) THEN 
     2242            CALL cpl_snd( jps_bio_co2, isec, RESHAPE( CO2Flux_out_cpl, (/jpi,jpj,1/) ), info ) 
     2243         ENDIF 
     2244 
     2245         IF ( ssnd(jps_bio_dms)%laction )  THEN 
     2246            CALL cpl_snd( jps_bio_dms, isec, RESHAPE( DMS_out_cpl, (/jpi,jpj,1/) ), info ) 
     2247         ENDIF 
     2248      ENDIF 
    22432249 
    22442250      !                                                      ! ------------------------- ! 
Note: See TracChangeset for help on using the changeset viewer.