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 – NEMO

Changeset 6681


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.

Location:
branches/UKMO/dev_r5518_GSI7_GSI8_landice_bitcomp_medusa/NEMOGCM/NEMO/OPA_SRC
Files:
2 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      !                                                      ! ------------------------- ! 
  • branches/UKMO/dev_r5518_GSI7_GSI8_landice_bitcomp_medusa/NEMOGCM/NEMO/OPA_SRC/oce.F90

    r6658 r6681  
    7171   !! Energy budget of the leads (open water embedded in sea ice) 
    7272   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   fraqsr_1lev        !: fraction of solar net radiation absorbed in the first ocean level [-] 
     73  
     74   !! Arrays used in coupling when MEDUSA is present. These arrays need to be declared 
     75   !! even if MEDUSA is not active, to allow compilation, in which case they will not be allocated.  
     76   !! --------------------- 
     77   REAL(wp), PUBLIC, ALLOCATABLE, SAVE :: CO2Flux_out_cpl(:,:)  ! Output coupling CO2 flux   
     78   REAL(wp), PUBLIC, ALLOCATABLE, SAVE :: DMS_out_cpl(:,:)      ! Output coupling DMS   
    7379 
     80   REAL(wp), PUBLIC, ALLOCATABLE, SAVE :: PCO2a_in_cpl(:,:)     ! Input coupling CO2 partial pressure  
     81   REAL(wp), PUBLIC, ALLOCATABLE, SAVE :: Dust_in_cpl(:,:)      ! Input coupling dust  
     82 
     83#if defined key_medusa 
     84   LOGICAL, PUBLIC, PARAMETER :: ln_medusa=.TRUE. ! Medusa switched on or off.  
     85#else 
     86   LOGICAL, PUBLIC, PARAMETER :: ln_medusa=.FALSE. ! Medusa switched on or off.  
     87#endif 
    7488   !!---------------------------------------------------------------------- 
    7589   !! NEMO/OPA 4.0 , NEMO Consortium (2011) 
     
    119133      ALLOCATE( fraqsr_1lev(jpi,jpj) , STAT=ierr(4) ) 
    120134         ! 
     135#if defined key_oasis3 
     136      IF (ln_medusa) THEN 
     137         ! We only actually need these arrays to be allocated if coupling and MEDUSA  
     138         ! are enabled 
     139         ALLOCATE( CO2Flux_out_cpl(jpi,jpj), DMS_out_cpl(jpi,jpj),               & 
     140                   PCO2a_in_cpl(jpi,jpj), Dust_in_cpl(jpi,jpj),     STAT=ierr(5) ) 
     141 
     142         ! RSRH Temporarily initialise output coupling fields while we await clarification 
     143         ! of exactly how these will be initialised at model startup! 
     144         DMS_out_cpl(:,:) = 0.0 
     145         CO2Flux_out_cpl(:,:) = 0.0 
     146      ENDIF 
     147#endif 
     148 
    121149      oce_alloc = MAXVAL( ierr ) 
    122150      IF( oce_alloc /= 0 )   CALL ctl_warn('oce_alloc: failed to allocate arrays') 
Note: See TracChangeset for help on using the changeset viewer.