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 5343 for branches/2015/dev_r5218_CNRS17_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90 – NEMO

Ignore:
Timestamp:
2015-06-04T09:48:48+02:00 (9 years ago)
Author:
smasson
Message:

dev_r5218_CNRS17_coupling: update and bugfix (mainly) for SAS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5218_CNRS17_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r5305 r5343  
    485485         srcv(jpr_otx1)%clgrid = 'U'        ! oce components given at U-point 
    486486         srcv(jpr_oty1)%clgrid = 'V'        !           and           V-point 
     487         ! Vectors: change of sign at north fold ONLY if on the local grid 
     488         srcv( (/jpr_otx1,jpr_oty1/) )%nsgn = -1. 
    487489         sn_rcv_tau%clvgrd = 'U,V' 
    488490         sn_rcv_tau%clvor = 'local grid' 
     
    981983      !  (arrays no more filled at sbcssm stage) 
    982984      !                                                      ! ================== ! 
    983       !                                                      !        SST         ! 
    984       !                                                      ! ================== ! 
    985       IF( srcv(jpr_toce)%laction ) THEN                      ! received by sas in case of opa <-> sas coupling 
    986          sst_m(:,:) = frcv(jpr_toce)%z3(:,:,1) 
    987          tsn(:,:,1,jp_tem) = sst_m(:,:) 
    988       ENDIF 
    989       !                                                      ! ================== ! 
    990985      !                                                      !        SSS         ! 
    991986      !                                                      ! ================== ! 
     
    993988         sss_m(:,:) = frcv(jpr_soce)%z3(:,:,1) 
    994989         tsn(:,:,1,jp_sal) = sss_m(:,:) 
     990      ENDIF 
     991      !                                                
     992      !                                                      ! ================== ! 
     993      !                                                      !        SST         ! 
     994      !                                                      ! ================== ! 
     995      IF( srcv(jpr_toce)%laction ) THEN                      ! received by sas in case of opa <-> sas coupling 
     996         sst_m(:,:) = frcv(jpr_toce)%z3(:,:,1) 
     997         tsn(:,:,1,jp_tem) = sst_m(:,:)                      ! keep the received (potential or conservative) temperature in tsn  
     998         IF( srcv(jpr_soce)%laction .AND. ln_useCT ) THEN    ! make sure that sst_m is the potential temperature 
     999            sst_m(:,:) = eos_pt_from_ct( sst_m(:,:), sss_m(:,:) ) 
     1000         ENDIF 
    9951001      ENDIF 
    9961002      !                                                      ! ================== ! 
     
    10571063         END IF 
    10581064         ! update qns over the free ocean with: 
    1059          zqns(:,:) =  zqns(:,:) - zemp(:,:) * sst_m(:,:) * rcp         ! remove heat content due to mass flux (assumed to be at SST) 
    1060          IF( srcv(jpr_snow  )%laction )   THEN 
    1061             zqns(:,:) = zqns(:,:) - frcv(jpr_snow)%z3(:,:,1) * lfus  ! energy for melting solid precipitation over the free ocean 
     1065         IF( nn_components /= jp_iam_opa ) THEN 
     1066            zqns(:,:) =  zqns(:,:) - zemp(:,:) * sst_m(:,:) * rcp         ! remove heat content due to mass flux (assumed to be at SST) 
     1067            IF( srcv(jpr_snow  )%laction ) THEN 
     1068               zqns(:,:) = zqns(:,:) - frcv(jpr_snow)%z3(:,:,1) * lfus    ! energy for melting solid precipitation over the free ocean 
     1069            ENDIF 
    10621070         ENDIF 
    10631071         IF( ln_mixcpl ) THEN   ;   qns(:,:) = qns(:,:) * xcplmask(:,:,0) + zqns(:,:) * zmsk(:,:) 
     
    10701078         ELSE                                       ;   zqsr(:,:) = 0._wp 
    10711079         ENDIF 
    1072          IF( ln_dm2dc )   zqsr(:,:) = sbc_dcy( zqsr )                           ! modify qsr to include the diurnal cycle 
     1080         IF( ln_dm2dc .AND. nn_components /= jp_iam_opa )   zqsr(:,:) = sbc_dcy( zqsr )   ! modify qsr to include the diurnal cycle 
    10731081         IF( ln_mixcpl ) THEN   ;   qsr(:,:) = qsr(:,:) * xcplmask(:,:,0) + zqsr(:,:) * zmsk(:,:) 
    10741082         ELSE                   ;   qsr(:,:) =                              zqsr(:,:) 
     
    16271635      !                                                      ! ------------------------- ! 
    16281636      IF( ssnd(jps_toce)%laction .OR. ssnd(jps_tice)%laction .OR. ssnd(jps_tmix)%laction ) THEN 
     1637          
    16291638         IF ( nn_components == jp_iam_opa ) THEN 
    1630             ztmp1(:,:) = tsn(:,:,1,jp_tem) 
     1639            ztmp1(:,:) = tsn(:,:,1,jp_tem)   ! send temperature as it is (potential or conservative) -> use of ln_useCT on the received part 
    16311640         ELSE 
     1641            ! we must send the surface potential temperature  
     1642            IF( ln_useCT )  THEN    ;   ztmp1(:,:) = eos_pt_from_ct( tsn(:,:,1,jp_tem), tsn(:,:,1,jp_sal) ) 
     1643            ELSE                    ;   ztmp1(:,:) = tsn(:,:,1,jp_tem) 
     1644            ENDIF 
     1645            ! 
    16321646            SELECT CASE( sn_snd_temp%cldes) 
    1633             CASE( 'oce only'             )   ;   ztmp1(:,:) =   tsn(:,:,1,jp_tem) + rt0 
    1634             CASE( 'weighted oce and ice' )   ;   ztmp1(:,:) = ( tsn(:,:,1,jp_tem) + rt0 ) * zfr_l(:,:)    
     1647            CASE( 'oce only'             )   ;   ztmp1(:,:) =   ztmp1(:,:) + rt0 
     1648            CASE( 'weighted oce and ice' )   ;   ztmp1(:,:) = ( ztmp1(:,:) + rt0 ) * zfr_l(:,:)    
    16351649               SELECT CASE( sn_snd_temp%clcat ) 
    16361650               CASE( 'yes' )    
     
    16441658               END SELECT 
    16451659            CASE( 'mixed oce-ice'        )    
    1646                ztmp1(:,:) = ( tsn(:,:,1,jp_tem) + rt0 ) * zfr_l(:,:)  
     1660               ztmp1(:,:) = ( ztmp1(:,:) + rt0 ) * zfr_l(:,:)  
    16471661               DO jl=1,jpl 
    16481662                  ztmp1(:,:) = ztmp1(:,:) + tn_ice(:,:,jl) * a_i(:,:,jl) 
Note: See TracChangeset for help on using the changeset viewer.