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 2063 for branches – NEMO

Changeset 2063 for branches


Ignore:
Timestamp:
2010-08-25T12:28:28+02:00 (14 years ago)
Author:
charris
Message:

First set of changes in prepration for multi-category ice fields, see ticket #662

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev_r1821_sbccpl_icecat/NEMO/OPA_SRC/SBC/sbccpl.F90

    r1766 r2063  
    8888   INTEGER, PARAMETER ::   jpr_cal    = 29            ! calving 
    8989   INTEGER, PARAMETER ::   jpr_taum   = 30            ! wind stress module 
    90 #if ! defined key_cpl_carbon_cycle 
    91    INTEGER, PARAMETER ::   jprcv      = 30            ! total number of fields received 
    92 #else 
    9390   INTEGER, PARAMETER ::   jpr_co2    = 31 
    9491   INTEGER, PARAMETER ::   jprcv      = 31            ! total number of fields received 
    95 #endif    
     92   ! 
    9693   INTEGER, PARAMETER ::   jps_fice   =  1            ! ice fraction  
    9794   INTEGER, PARAMETER ::   jps_toce   =  2            ! ocean temperature 
     
    108105   INTEGER, PARAMETER ::   jps_ivy1   = 13            ! 
    109106   INTEGER, PARAMETER ::   jps_ivz1   = 14            ! 
    110 #if ! defined key_cpl_carbon_cycle 
    111    INTEGER, PARAMETER ::   jpsnd      = 14            ! total number of fields sended 
    112 #else 
    113107   INTEGER, PARAMETER ::   jps_co2    = 15 
    114108   INTEGER, PARAMETER ::   jpsnd      = 15            ! total number of fields sended 
    115 #endif    
    116    !                                                         !!** namelist namsbc_cpl ** 
    117    ! Send to the atmosphere                                   ! 
    118    CHARACTER(len=100) ::   cn_snd_temperature = 'oce only'    ! 'oce only' 'weighted oce and ice' or 'mixed oce-ice' 
    119    CHARACTER(len=100) ::   cn_snd_albedo      = 'none'        ! 'none' 'weighted ice' or 'mixed oce-ice' 
    120    CHARACTER(len=100) ::   cn_snd_thickness   = 'none'        ! 'none' or 'weighted ice and snow' 
    121    CHARACTER(len=100) ::   cn_snd_crt_nature  = 'none'        ! 'none' 'oce only' 'weighted oce and ice' or 'mixed oce-ice'    
    122    CHARACTER(len=100) ::   cn_snd_crt_refere  = 'spherical'   ! 'spherical' or 'cartesian' 
    123    CHARACTER(len=100) ::   cn_snd_crt_orient  = 'local grid'  ! 'eastward-northward' or 'local grid' 
    124    CHARACTER(len=100) ::   cn_snd_crt_grid    = 'T'           ! always at 'T' point 
    125 #if defined key_cpl_carbon_cycle  
    126    CHARACTER(len=100) ::   cn_snd_co2         = 'none'        ! 'none' or 'coupled' 
    127 #endif 
    128    ! Received from the atmosphere                             ! 
    129    CHARACTER(len=100) ::   cn_rcv_tau_nature  = 'oce only'    ! 'oce only' 'oce and ice' or 'mixed oce-ice' 
    130    CHARACTER(len=100) ::   cn_rcv_tau_refere  = 'spherical'   ! 'spherical' or 'cartesian' 
    131    CHARACTER(len=100) ::   cn_rcv_tau_orient  = 'local grid'  ! 'eastward-northward' or 'local grid' 
    132    CHARACTER(len=100) ::   cn_rcv_tau_grid    = 'T'           ! 'T', 'U,V', 'U,V,I', 'T,I', or 'T,U,V' 
    133    CHARACTER(len=100) ::   cn_rcv_w10m        = 'none'        ! 'none' or 'coupled' 
    134    CHARACTER(len=100) ::   cn_rcv_dqnsdt      = 'none'        ! 'none' or 'coupled' 
    135    CHARACTER(len=100) ::   cn_rcv_qsr         = 'oce only'    ! 'oce only' 'conservative' 'oce and ice' or 'mixed oce-ice' 
    136    CHARACTER(len=100) ::   cn_rcv_qns         = 'oce only'    ! 'oce only' 'conservative' 'oce and ice' or 'mixed oce-ice' 
    137    CHARACTER(len=100) ::   cn_rcv_emp         = 'oce only'    ! 'oce only' 'conservative' or 'oce and ice' 
    138    CHARACTER(len=100) ::   cn_rcv_rnf         = 'coupled'     ! 'coupled' 'climato' or 'mixed' 
    139    CHARACTER(len=100) ::   cn_rcv_cal         = 'none'        ! 'none' or 'coupled' 
    140    CHARACTER(len=100) ::   cn_rcv_taumod      = 'none'        ! 'none' or 'coupled' 
    141 #if defined key_cpl_carbon_cycle  
    142    CHARACTER(len=100) ::   cn_rcv_co2         = 'none'        ! 'none' or 'coupled' 
    143 #endif 
     109   ! 
     110   !                                                  !!** namelist namsbc_cpl ** 
     111   TYPE ::   FLD_C 
     112      CHARACTER(len = 32) ::   cldes                  ! desciption of the coupling strategy 
     113      CHARACTER(len = 32) ::   clcat                  ! multiple ice categories strategy 
     114      CHARACTER(len = 32) ::   clvref                 ! reference of vector ('spherical' or 'cartesian') 
     115      CHARACTER(len = 32) ::   clvor                  ! orientation of vector fields ('eastward-northward' or 'local grid') 
     116      CHARACTER(len = 32) ::   clvgrd                 ! grids on which is located the vector fields 
     117   END TYPE FLD_C 
     118   ! Send to the atmosphere                           ! 
     119   TYPE(FLD_C) ::   sn_snd_temp                       ! 'oce only' 'weighted oce and ice' or 'mixed oce-ice' 
     120   TYPE(FLD_C) ::   sn_snd_alb                        ! 'none' 'weighted ice' or 'mixed oce-ice' 
     121   TYPE(FLD_C) ::   sn_snd_thick                      ! 'none' or 'weighted ice and snow' 
     122   TYPE(FLD_C) ::   sn_snd_crt                        ! 'none' 'oce only' 'weighted oce and ice' or 'mixed oce-ice'   
     123   TYPE(FLD_C) ::   sn_snd_co2                        ! 'none' or 'coupled' 
     124   ! Received from the atmosphere                     ! 
     125   TYPE(FLD_C) ::   sn_rcv_w10m                       ! 'none' or 'coupled' 
     126   TYPE(FLD_C) ::   sn_rcv_taumod                     ! 'none' or 'coupled' 
     127   TYPE(FLD_C) ::   sn_rcv_tau                        ! 'oce only' 'oce and ice' or 'mixed oce-ice' 
     128   TYPE(FLD_C) ::   sn_rcv_dqnsdt                     ! 'none' or 'coupled' 
     129   TYPE(FLD_C) ::   sn_rcv_qsr                        ! 'oce only' 'conservative' 'oce and ice' or 'mixed oce-ice' 
     130   TYPE(FLD_C) ::   sn_rcv_qns                        ! 'oce only' 'conservative' 'oce and ice' or 'mixed oce-ice' 
     131   TYPE(FLD_C) ::   sn_rcv_emp                        ! 'oce only' 'conservative' or 'oce and ice' 
     132   TYPE(FLD_C) ::   sn_rcv_rnf                        ! 'coupled' 'climato' or 'mixed' 
     133   TYPE(FLD_C) ::   sn_rcv_cal                        ! 'none' or 'coupled' 
     134   TYPE(FLD_C) ::   sn_rcv_co2                        ! 'none' or 'coupled' 
    144135 
    145136!!   CHARACTER(len=100), PUBLIC ::   cn_rcv_rnf   !: ???             ==>>  !!gm   treat this case in a different maner 
    146137    
    147    CHARACTER(len=100), DIMENSION(4) ::   cn_snd_crt           ! array combining cn_snd_crt_* 
    148    CHARACTER(len=100), DIMENSION(4) ::   cn_rcv_tau           ! array combining cn_rcv_tau_* 
    149  
    150138   REAL(wp), DIMENSION(jpi,jpj)       ::   albedo_oce_mix     ! ocean albedo sent to atmosphere (mix clear/overcast sky) 
    151  
    152139   REAL(wp), DIMENSION(jpi,jpj,jprcv) ::   frcv               ! all fields recieved from the atmosphere 
    153140   INTEGER , DIMENSION(        jprcv) ::   nrcvinfo           ! OASIS info argument 
     
    178165      !! 
    179166      INTEGER                      ::   jn           ! dummy loop index 
     167      CHARACTER(len = 256) ::   clname      ! generic name of the NetCDF flux file 
    180168      REAL(wp), DIMENSION(jpi,jpj) ::   zacs, zaos   ! 2D workspace (clear & overcast sky albedos) 
    181169      !! 
    182       NAMELIST/namsbc_cpl/  cn_snd_temperature, cn_snd_albedo    , cn_snd_thickness,                 &           
    183          cn_snd_crt_nature, cn_snd_crt_refere , cn_snd_crt_orient, cn_snd_crt_grid ,                 & 
    184          cn_rcv_w10m      , cn_rcv_taumod     ,                                                      & 
    185          cn_rcv_tau_nature, cn_rcv_tau_refere , cn_rcv_tau_orient, cn_rcv_tau_grid ,                 & 
    186          cn_rcv_dqnsdt    , cn_rcv_qsr        , cn_rcv_qns       , cn_rcv_emp      , cn_rcv_rnf , cn_rcv_cal 
    187 #if defined key_cpl_carbon_cycle  
    188       NAMELIST/namsbc_cpl_co2/  cn_snd_co2, cn_rcv_co2 
    189 #endif 
     170      NAMELIST/namsbc_cpl/  sn_snd_temp, sn_snd_alb   , sn_snd_thick, sn_snd_crt   , sn_snd_co2,   & 
     171         &                  sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau  , sn_rcv_dqnsdt, sn_rcv_qsr,   & 
     172         &                  sn_rcv_qns , sn_rcv_emp   , sn_rcv_rnf  , sn_rcv_cal   , sn_rcv_co2 
    190173      !!--------------------------------------------------------------------- 
    191174 
     
    193176      !      Namelist informations       ! 
    194177      ! ================================ ! 
     178 
     179      ! default definitions 
     180      !                    !     description       !  multiple  !    vector   !      vector          ! vector ! 
     181      !                    !                       ! categories !  reference  !    orientation       ! grids  ! 
     182      ! send 
     183      sn_snd_temp   = FLD_C( 'weighted oce and ice',    'no'    ,     ''      ,         ''           ,   ''   )  
     184      sn_snd_alb    = FLD_C( 'weighted ice'        ,    'no'    ,     ''      ,         ''           ,   ''   )  
     185      sn_snd_thick  = FLD_C( 'none'                ,    'no'    ,     ''      ,         ''           ,   ''   )  
     186      sn_snd_crt    = FLD_C( 'none'                ,    'no'    , 'spherical' , 'eastward-northward' ,  'T'   )      
     187      sn_snd_co2    = FLD_C( 'none'                ,    'no'    ,     ''      ,         ''           ,   ''   )      
     188      ! receive 
     189      sn_rcv_w10m   = FLD_C( 'none'                ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     190      sn_rcv_taumod = FLD_C( 'coupled'             ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     191      sn_rcv_tau    = FLD_C( 'oce only'            ,    'no'    , 'cartesian' , 'eastward-northward',  'U,V'  )   
     192      sn_rcv_dqnsdt = FLD_C( 'coupled'             ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     193      sn_rcv_qsr    = FLD_C( 'oce and ice'         ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     194      sn_rcv_qns    = FLD_C( 'oce and ice'         ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     195      sn_rcv_emp    = FLD_C( 'conservative'        ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     196      sn_rcv_rnf    = FLD_C( 'coupled'             ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     197      sn_rcv_cal    = FLD_C( 'coupled'             ,    'no'    ,     ''      ,         ''          ,   ''    ) 
     198      sn_rcv_co2    = FLD_C( 'none'                ,    'no'    ,     ''      ,         ''          ,   ''    ) 
    195199 
    196200      REWIND( numnam )                    ! ... read namlist namsbc_cpl 
     
    201205         WRITE(numout,*)'sbc_cpl_init : namsbc_cpl namelist ' 
    202206         WRITE(numout,*)'~~~~~~~~~~~~' 
    203          WRITE(numout,*)'   received fields' 
    204          WRITE(numout,*)'       10m wind module                    cn_rcv_w10m        = ', cn_rcv_w10m  
    205          WRITE(numout,*)'       surface stress - nature            cn_rcv_tau_nature  = ', cn_rcv_tau_nature 
    206          WRITE(numout,*)'                      - referential       cn_rcv_tau_refere  = ', cn_rcv_tau_refere 
    207          WRITE(numout,*)'                      - orientation       cn_rcv_tau_orient  = ', cn_rcv_tau_orient 
    208          WRITE(numout,*)'                      - mesh              cn_rcv_tau_grid    = ', cn_rcv_tau_grid 
    209          WRITE(numout,*)'       non-solar heat flux sensitivity    cn_rcv_dqnsdt      = ', cn_rcv_dqnsdt 
    210          WRITE(numout,*)'       solar heat flux                    cn_rcv_qsr         = ', cn_rcv_qsr   
    211          WRITE(numout,*)'       non-solar heat flux                cn_rcv_qns         = ', cn_rcv_qns 
    212          WRITE(numout,*)'       freshwater budget                  cn_rcv_emp         = ', cn_rcv_emp 
    213          WRITE(numout,*)'       runoffs                            cn_rcv_rnf         = ', cn_rcv_rnf 
    214          WRITE(numout,*)'       calving                            cn_rcv_cal         = ', cn_rcv_cal  
    215          WRITE(numout,*)'       stress module                      cn_rcv_taumod      = ', cn_rcv_taumod 
    216          WRITE(numout,*)'   sent fields' 
    217          WRITE(numout,*)'       surface temperature                cn_snd_temperature = ', cn_snd_temperature 
    218          WRITE(numout,*)'       albedo                             cn_snd_albedo      = ', cn_snd_albedo 
    219          WRITE(numout,*)'       ice/snow thickness                 cn_snd_thickness   = ', cn_snd_thickness   
    220          WRITE(numout,*)'       surface current - nature           cn_snd_crt_nature  = ', cn_snd_crt_nature  
    221          WRITE(numout,*)'                       - referential      cn_snd_crt_refere  = ', cn_snd_crt_refere  
    222          WRITE(numout,*)'                       - orientation      cn_snd_crt_orient  = ', cn_snd_crt_orient 
    223          WRITE(numout,*)'                       - mesh             cn_snd_crt_grid    = ', cn_snd_crt_grid  
    224       ENDIF 
    225  
    226 #if defined key_cpl_carbon_cycle  
    227       REWIND( numnam )                    ! ... read namlist namsbc_cpl_co2 
    228       READ  ( numnam, namsbc_cpl_co2 ) 
    229       IF(lwp) THEN                        ! control print 
    230          WRITE(numout,*) 
    231          WRITE(numout,*)'sbc_cpl_init : namsbc_cpl_co2 namelist ' 
    232          WRITE(numout,*)'~~~~~~~~~~~~' 
    233          WRITE(numout,*)'   received fields' 
    234          WRITE(numout,*)'       atm co2                            cn_rcv_co2         = ', cn_rcv_co2 
    235          WRITE(numout,*)'   sent fields' 
    236          WRITE(numout,*)'      oce co2 flux                        cn_snd_co2         = ', cn_snd_co2 
    237           WRITE(numout,*) 
    238       ENDIF 
    239 #endif 
    240       ! save current & stress in an array and suppress possible blank in the name 
    241       cn_snd_crt(1) = TRIM( cn_snd_crt_nature )   ;   cn_snd_crt(2) = TRIM( cn_snd_crt_refere ) 
    242       cn_snd_crt(3) = TRIM( cn_snd_crt_orient )   ;   cn_snd_crt(4) = TRIM( cn_snd_crt_grid   ) 
    243       cn_rcv_tau(1) = TRIM( cn_rcv_tau_nature )   ;   cn_rcv_tau(2) = TRIM( cn_rcv_tau_refere ) 
    244       cn_rcv_tau(3) = TRIM( cn_rcv_tau_orient )   ;   cn_rcv_tau(4) = TRIM( cn_rcv_tau_grid   ) 
     207         WRITE(numout,*)'  received fields (mutiple ice categogies)' 
     208         WRITE(numout,*)'      10m wind module                 = ', TRIM(sn_rcv_w10m%cldes  ), ' (', TRIM(sn_rcv_w10m%clcat  ), ')' 
     209         WRITE(numout,*)'      stress module                   = ', TRIM(sn_rcv_taumod%cldes), ' (', TRIM(sn_rcv_taumod%clcat), ')' 
     210         WRITE(numout,*)'      surface stress                  = ', TRIM(sn_rcv_tau%cldes   ), ' (', TRIM(sn_rcv_tau%clcat   ), ')' 
     211         WRITE(numout,*)'                     - referential    = ', sn_rcv_tau%clvref 
     212         WRITE(numout,*)'                     - orientation    = ', sn_rcv_tau%clvor 
     213         WRITE(numout,*)'                     - mesh           = ', sn_rcv_tau%clvgrd 
     214         WRITE(numout,*)'      non-solar heat flux sensitivity = ', TRIM(sn_rcv_dqnsdt%cldes), ' (', TRIM(sn_rcv_dqnsdt%clcat), ')' 
     215         WRITE(numout,*)'      solar heat flux                 = ', TRIM(sn_rcv_qsr%cldes   ), ' (', TRIM(sn_rcv_qsr%clcat   ), ')' 
     216         WRITE(numout,*)'      non-solar heat flux             = ', TRIM(sn_rcv_qns%cldes   ), ' (', TRIM(sn_rcv_qns%clcat   ), ')' 
     217         WRITE(numout,*)'      freshwater budget               = ', TRIM(sn_rcv_emp%cldes   ), ' (', TRIM(sn_rcv_emp%clcat   ), ')' 
     218         WRITE(numout,*)'      runoffs                         = ', TRIM(sn_rcv_rnf%cldes   ), ' (', TRIM(sn_rcv_rnf%clcat   ), ')' 
     219         WRITE(numout,*)'      calving                         = ', TRIM(sn_rcv_cal%cldes   ), ' (', TRIM(sn_rcv_cal%clcat   ), ')' 
     220         WRITE(numout,*)'      atm co2                         = ', TRIM(sn_rcv_co2%cldes   ), ' (', TRIM(sn_rcv_co2%clcat   ), ')' 
     221         WRITE(numout,*)'  sent fields (mutiple ice categogies)' 
     222         WRITE(numout,*)'      surface temperature             = ', TRIM(sn_snd_temp%cldes  ), ' (', TRIM(sn_snd_temp%clcat  ), ')' 
     223         WRITE(numout,*)'      albedo                          = ', TRIM(sn_snd_alb%cldes   ), ' (', TRIM(sn_snd_alb%clcat   ), ')' 
     224         WRITE(numout,*)'      ice/snow thickness              = ', TRIM(sn_snd_thick%cldes ), ' (', TRIM(sn_snd_thick%clcat ), ')' 
     225         WRITE(numout,*)'      surface current                 = ', TRIM(sn_snd_crt%cldes   ), ' (', TRIM(sn_snd_crt%clcat   ), ')' 
     226         WRITE(numout,*)'                      - referential   = ', sn_snd_crt%clvref  
     227         WRITE(numout,*)'                      - orientation   = ', sn_snd_crt%clvor 
     228         WRITE(numout,*)'                      - mesh          = ', sn_snd_crt%clvgrd 
     229         WRITE(numout,*)'      oce co2 flux                    = ', TRIM(sn_snd_co2%cldes   ), ' (', TRIM(sn_snd_co2%clcat   ), ')' 
     230      ENDIF 
    245231      
    246232      ! ================================ ! 
     
    274260      srcv(jpr_itz2)%clname = 'O_ITauz2'      ! 3rd   -      -         -     -  
    275261      !  
    276       srcv(jpr_otx1:jpr_itz2)%nsgn = -1                           ! Vectors: change of sign at north fold 
     262      ! Vectors: change of sign at north fold ONLY if on the local grid 
     263      IF( TRIM( sn_rcv_tau%clvor ) == 'local grid' )   srcv(jpr_otx1:jpr_itz2)%nsgn = -1. 
    277264       
    278265      !                                                           ! Set grid and action 
    279       SELECT CASE( TRIM( cn_rcv_tau(4) ) )      !  'T', 'U,V', 'U,V,I', 'U,V,F', 'T,I', 'T,F', or 'T,U,V' 
     266      SELECT CASE( TRIM( sn_rcv_tau%clvgrd ) )        !  'T', 'U,V', 'U,V,I', 'U,V,F', 'T,I', 'T,F', or 'T,U,V' 
    280267      CASE( 'T' )  
    281268         srcv(jpr_otx1:jpr_itz2)%clgrid  = 'T'        ! oce and ice components given at T-point 
     
    323310         srcv(jpr_itx1:jpr_itz2)%laction = .TRUE.     ! receive ice components on grid 1 & 2 
    324311      CASE default    
    325          CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_rcv_tau(4)' ) 
     312         CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_tau%clvgrd' ) 
    326313      END SELECT 
    327314      ! 
    328       IF( TRIM( cn_rcv_tau(2) ) == 'spherical' )   &           ! spherical: 3rd component not received 
     315      IF( TRIM( sn_rcv_tau%clvref ) == 'spherical' )   &           ! spherical: 3rd component not received 
    329316         &     srcv( (/jpr_otz1, jpr_otz2, jpr_itz1, jpr_itz2/) )%laction = .FALSE.  
    330317      ! 
    331       IF( TRIM( cn_rcv_tau(1) ) /= 'oce and ice' ) THEN        ! 'oce and ice' case ocean stress on ocean mesh used 
     318      IF( TRIM( sn_rcv_tau%cldes ) /= 'oce and ice' ) THEN        ! 'oce and ice' case ocean stress on ocean mesh used 
    332319         srcv(jpr_itx1:jpr_itz2)%laction = .FALSE.    ! ice components not received 
    333320         srcv(jpr_itx1)%clgrid = 'U'                  ! ocean stress used after its transformation 
     
    347334      srcv(jpr_semp)%clname = 'OISubMSn'      ! ice solid water budget = sublimation - solid precipitation 
    348335      srcv(jpr_oemp)%clname = 'OOEvaMPr'      ! ocean water budget = ocean Evap - ocean precip 
    349       SELECT CASE( TRIM( cn_rcv_emp ) ) 
     336      SELECT CASE( TRIM( sn_rcv_emp%cldes ) ) 
    350337      CASE( 'oce only'      )   ;   srcv(                                 jpr_oemp   )%laction = .TRUE.  
    351338      CASE( 'conservative'  )   ;   srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE. 
    352339      CASE( 'oce and ice'   )   ;   srcv( (/jpr_ievp, jpr_sbpr, jpr_semp, jpr_oemp/) )%laction = .TRUE. 
    353       CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_rcv_emp' ) 
     340      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_emp%cldes' ) 
    354341      END SELECT 
    355342 
     
    357344      !                                                      !     Runoffs & Calving     !    
    358345      !                                                      ! ------------------------- ! 
    359       srcv(jpr_rnf   )%clname = 'O_Runoff'   ;   IF( TRIM( cn_rcv_rnf ) == 'coupled' )   srcv(jpr_rnf)%laction = .TRUE. 
    360                                                  IF( TRIM( cn_rcv_rnf ) == 'climato' )   THEN   ;   ln_rnf = .TRUE. 
    361                                                  ELSE                                           ;   ln_rnf = .FALSE. 
     346      srcv(jpr_rnf   )%clname = 'O_Runoff'   ;   IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' )   srcv(jpr_rnf)%laction = .TRUE. 
     347                                                 IF( TRIM( sn_rcv_rnf%cldes ) == 'climato' )   THEN   ;   ln_rnf = .TRUE. 
     348                                                 ELSE                                                 ;   ln_rnf = .FALSE. 
    362349                                                 ENDIF 
    363       srcv(jpr_cal   )%clname = 'OCalving'   ;   IF( TRIM( cn_rcv_cal ) == 'coupled' )   srcv(jpr_cal)%laction = .TRUE. 
     350      srcv(jpr_cal   )%clname = 'OCalving'   ;   IF( TRIM( sn_rcv_cal%cldes ) == 'coupled' )   srcv(jpr_cal)%laction = .TRUE. 
    364351 
    365352      !                                                      ! ------------------------- ! 
     
    369356      srcv(jpr_qnsice)%clname = 'O_QnsIce' 
    370357      srcv(jpr_qnsmix)%clname = 'O_QnsMix' 
    371       SELECT CASE( TRIM( cn_rcv_qns ) ) 
     358      SELECT CASE( TRIM( sn_rcv_qns%cldes ) ) 
    372359      CASE( 'oce only'      )   ;   srcv(               jpr_qnsoce   )%laction = .TRUE. 
    373360      CASE( 'conservative'  )   ;   srcv( (/jpr_qnsice, jpr_qnsmix/) )%laction = .TRUE. 
    374361      CASE( 'oce and ice'   )   ;   srcv( (/jpr_qnsice, jpr_qnsoce/) )%laction = .TRUE. 
    375362      CASE( 'mixed oce-ice' )   ;   srcv(               jpr_qnsmix   )%laction = .TRUE.  
    376       CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_rcv_qns' ) 
     363      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_qns%cldes' ) 
    377364      END SELECT 
    378365 
     
    383370      srcv(jpr_qsrice)%clname = 'O_QsrIce' 
    384371      srcv(jpr_qsrmix)%clname = 'O_QsrMix' 
    385       SELECT CASE( TRIM( cn_rcv_qsr ) ) 
     372      SELECT CASE( TRIM( sn_rcv_qsr%cldes ) ) 
    386373      CASE( 'oce only'      )   ;   srcv(               jpr_qsroce   )%laction = .TRUE. 
    387374      CASE( 'conservative'  )   ;   srcv( (/jpr_qsrice, jpr_qsrmix/) )%laction = .TRUE. 
    388375      CASE( 'oce and ice'   )   ;   srcv( (/jpr_qsrice, jpr_qsroce/) )%laction = .TRUE. 
    389376      CASE( 'mixed oce-ice' )   ;   srcv(               jpr_qsrmix   )%laction = .TRUE.  
    390       CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_rcv_qsr' ) 
     377      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_qsr%cldes' ) 
    391378      END SELECT 
    392379 
     
    395382      !                                                      ! ------------------------- ! 
    396383      srcv(jpr_dqnsdt)%clname = 'O_dQnsdT'    
    397       IF( TRIM( cn_rcv_dqnsdt ) == 'coupled' )   srcv(jpr_dqnsdt)%laction = .TRUE. 
     384      IF( TRIM( sn_rcv_dqnsdt%cldes ) == 'coupled' )   srcv(jpr_dqnsdt)%laction = .TRUE. 
    398385      ! 
    399386      ! non solar sensitivity mandatory for ice model 
    400       IF( TRIM( cn_rcv_dqnsdt ) == 'none' .AND. k_ice /= 0 ) & 
    401          CALL ctl_stop( 'sbc_cpl_init: cn_rcv_dqnsdt must be coupled in namsbc_cpl namelist' ) 
     387      IF( TRIM( sn_rcv_dqnsdt%cldes ) == 'none' .AND. k_ice /= 0 ) & 
     388         CALL ctl_stop( 'sbc_cpl_init: sn_rcv_dqnsdt%cldes must be coupled in namsbc_cpl namelist' ) 
    402389      ! non solar sensitivity mandatory for mixed oce-ice solar radiation coupling technique 
    403       IF( TRIM( cn_rcv_dqnsdt ) == 'none' .AND. TRIM( cn_rcv_qns ) == 'mixed oce-ice' ) & 
    404          CALL ctl_stop( 'sbc_cpl_init: namsbc_cpl namelist mismatch between cn_rcv_qns and cn_rcv_dqnsdt' ) 
     390      IF( TRIM( sn_rcv_dqnsdt%cldes ) == 'none' .AND. TRIM( sn_rcv_qns%cldes ) == 'mixed oce-ice' ) & 
     391         CALL ctl_stop( 'sbc_cpl_init: namsbc_cpl namelist mismatch between sn_rcv_qns%cldes and sn_rcv_dqnsdt%cldes' ) 
    405392      !                                                      ! ------------------------- ! 
    406393      !                                                      !    Ice Qsr penetration    !    
     
    415402      !                                                      !      10m wind module      !    
    416403      !                                                      ! ------------------------- ! 
    417       srcv(jpr_w10m)%clname = 'O_Wind10'   ;   IF( TRIM(cn_rcv_w10m ) == 'coupled' )   srcv(jpr_w10m)%laction = .TRUE.  
     404      srcv(jpr_w10m)%clname = 'O_Wind10'   ;   IF( TRIM(sn_rcv_w10m %cldes ) == 'coupled' )   srcv(jpr_w10m)%laction = .TRUE.  
    418405      ! 
    419406      !                                                      ! ------------------------- ! 
    420407      !                                                      !   wind stress module      !    
    421408      !                                                      ! ------------------------- ! 
    422       srcv(jpr_taum)%clname = 'O_TauMod'   ;   IF( TRIM(cn_rcv_taumod) == 'coupled' )   srcv(jpr_taum)%laction = .TRUE. 
     409      srcv(jpr_taum)%clname = 'O_TauMod'   ;   IF( TRIM(sn_rcv_taumod%cldes) == 'coupled' )   srcv(jpr_taum)%laction = .TRUE. 
    423410      lhftau = srcv(jpr_taum)%laction 
    424411 
    425 #if defined key_cpl_carbon_cycle 
    426412      !                                                      ! ------------------------- ! 
    427413      !                                                      !      Atmospheric CO2      ! 
    428414      !                                                      ! ------------------------- ! 
    429       srcv(jpr_co2 )%clname = 'O_AtmCO2'   ;   IF( TRIM(cn_rcv_co2   ) == 'coupled' )    srcv(jpr_co2 )%laction = .TRUE. 
    430 #endif 
     415      srcv(jpr_co2 )%clname = 'O_AtmCO2'   ;   IF( TRIM(sn_rcv_co2%cldes   ) == 'coupled' )    srcv(jpr_co2 )%laction = .TRUE. 
    431416      
    432417      ! ================================ ! 
     
    446431      ssnd(jps_tice)%clname = 'O_TepIce' 
    447432      ssnd(jps_tmix)%clname = 'O_TepMix' 
    448       SELECT CASE( TRIM( cn_snd_temperature ) ) 
     433      SELECT CASE( TRIM( sn_snd_temp%cldes ) ) 
    449434      CASE( 'oce only'             )   ;   ssnd(   jps_toce             )%laction = .TRUE. 
    450435      CASE( 'weighted oce and ice' )   ;   ssnd( (/jps_toce, jps_tice/) )%laction = .TRUE. 
    451436      CASE( 'mixed oce-ice'        )   ;   ssnd(   jps_tmix             )%laction = .TRUE. 
    452       CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_snd_temperature' ) 
     437      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_temp%cldes' ) 
    453438      END SELECT 
    454439      
     
    458443      ssnd(jps_albice)%clname = 'O_AlbIce'  
    459444      ssnd(jps_albmix)%clname = 'O_AlbMix' 
    460       SELECT CASE( TRIM( cn_snd_albedo ) ) 
     445      SELECT CASE( TRIM( sn_snd_alb%cldes ) ) 
    461446      CASE( 'none'          )       ! nothing to do 
    462447      CASE( 'weighted ice'  )   ;   ssnd(jps_albice)%laction = .TRUE. 
    463448      CASE( 'mixed oce-ice' )   ;   ssnd(jps_albmix)%laction = .TRUE. 
    464       CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_snd_albedo' ) 
     449      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_alb%cldes' ) 
    465450      END SELECT 
    466451      ! 
     
    468453      !     1. sending mixed oce-ice albedo or 
    469454      !     2. receiving mixed oce-ice solar radiation  
    470       IF ( TRIM ( cn_snd_albedo ) == 'mixed oce-ice' .OR. TRIM ( cn_rcv_qsr ) == 'mixed oce-ice' ) THEN 
     455      IF ( TRIM ( sn_snd_alb%cldes ) == 'mixed oce-ice' .OR. TRIM ( sn_rcv_qsr%cldes ) == 'mixed oce-ice' ) THEN 
    471456         CALL albedo_oce( zaos, zacs ) 
    472457         ! Due to lack of information on nebulosity : mean clear/overcast sky 
     
    481466      ssnd(jps_hsnw)%clname = 'O_SnwTck' 
    482467      IF( k_ice /= 0 )   ssnd(jps_fice)%laction = .TRUE.       ! if ice treated in the ocean (even in climato case) 
    483       IF( TRIM( cn_snd_thickness ) == 'weighted ice and snow' )   ssnd( (/jps_hice, jps_hsnw/) )%laction = .TRUE. 
     468      IF( TRIM( sn_snd_thick%cldes ) == 'weighted ice and snow' )   ssnd( (/jps_hice, jps_hsnw/) )%laction = .TRUE. 
    484469          
    485470      !                                                      ! ------------------------- ! 
     
    493478      ssnd(jps_ocx1:jps_ivz1)%nsgn = -1    ! vectors: change of the sign at the north fold 
    494479 
    495       IF( cn_snd_crt(4) /= 'T' )   CALL ctl_stop( 'cn_snd_crt(4) must be equal to T' ) 
     480      IF( sn_snd_crt%clvgrd /= 'T' )   CALL ctl_stop( 'sn_snd_crt%clvgrd must be equal to T' ) 
    496481      ssnd(jps_ocx1:jps_ivz1)%clgrid  = 'T'      ! all oce and ice components on the same unique grid 
    497482 
    498483      ssnd(jps_ocx1:jps_ivz1)%laction = .TRUE.   ! default: all are send 
    499       IF( TRIM( cn_snd_crt(2) ) == 'spherical' )   ssnd( (/jps_ocz1, jps_ivz1/) )%laction = .FALSE.  
    500       SELECT CASE( TRIM( cn_snd_crt(1) ) ) 
     484      IF( TRIM( sn_snd_crt%clvref ) == 'spherical' )   ssnd( (/jps_ocz1, jps_ivz1/) )%laction = .FALSE.  
     485      SELECT CASE( TRIM( sn_snd_crt%cldes ) ) 
    501486      CASE( 'none'                 )   ;   ssnd(jps_ocx1:jps_ivz1)%laction = .FALSE. 
    502487      CASE( 'oce only'             )   ;   ssnd(jps_ivx1:jps_ivz1)%laction = .FALSE. 
    503488      CASE( 'weighted oce and ice' )   !   nothing to do 
    504489      CASE( 'mixed oce-ice'        )   ;   ssnd(jps_ivx1:jps_ivz1)%laction = .FALSE. 
    505       CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_snd_crt(1)' ) 
     490      CASE default   ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_crt%cldes' ) 
    506491      END SELECT 
    507492 
    508 #if defined key_cpl_carbon_cycle 
    509493      !                                                      ! ------------------------- ! 
    510494      !                                                      !          CO2 flux         ! 
    511495      !                                                      ! ------------------------- ! 
    512       ssnd(jps_co2)%clname = 'O_CO2FLX' ;  IF( TRIM(cn_snd_co2) == 'coupled' )    ssnd(jps_co2 )%laction = .TRUE. 
    513 #endif 
     496      ssnd(jps_co2)%clname = 'O_CO2FLX' ;  IF( TRIM(sn_snd_co2%cldes) == 'coupled' )    ssnd(jps_co2 )%laction = .TRUE. 
     497 
    514498      ! 
    515499      ! ================================ ! 
     
    594578         IF(  nrcvinfo(jpr_otx1) == OASIS_Rcv ) THEN 
    595579            ! 
    596             IF( TRIM( cn_rcv_tau(2) ) == 'cartesian' ) THEN            ! 2 components on the sphere 
     580            IF( TRIM( sn_rcv_tau%clvref ) == 'cartesian' ) THEN        ! 2 components on the sphere 
    597581               !                                                       ! (cartesian to spherical -> 3 to 2 components) 
    598582               ! 
     
    611595            ENDIF 
    612596            ! 
    613             IF( TRIM( cn_rcv_tau(3) ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid 
    614                !                                                       ! (geographical to local grid -> rotate the components) 
     597            IF( TRIM( sn_rcv_tau%clvor ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid 
     598               !                                                          ! (geographical to local grid -> rotate the components) 
    615599               CALL rot_rep( frcv(:,:,jpr_otx1), frcv(:,:,jpr_oty1), srcv(jpr_otx1)%clgrid, 'en->i', ztx )    
    616600               frcv(:,:,jpr_otx1) = ztx(:,:)      ! overwrite 1st component on the 1st grid 
     
    722706         ! 
    723707         !                                                       ! total freshwater fluxes over the ocean (emp, emps) 
    724          SELECT CASE( TRIM( cn_rcv_emp ) )                                    ! evaporation - precipitation 
     708         SELECT CASE( TRIM( sn_rcv_emp%cldes ) )                 ! evaporation - precipitation 
    725709         CASE( 'conservative' ) 
    726710            emp(:,:) = frcv(:,:,jpr_tevp) - ( frcv(:,:,jpr_rain) + frcv(:,:,jpr_snow) ) 
     
    728712            emp(:,:) = frcv(:,:,jpr_oemp) 
    729713         CASE default 
    730             CALL ctl_stop( 'sbc_cpl_rcv: wrong definition of cn_rcv_emp' ) 
     714            CALL ctl_stop( 'sbc_cpl_rcv: wrong definition of sn_rcv_emp%cldes' ) 
    731715         END SELECT 
    732716         ! 
     
    737721!!gm :  this seems to be internal cooking, not sure to need that in a generic interface  
    738722!!gm                                       at least should be optional... 
    739 !!         IF( TRIM( cn_rcv_rnf ) == 'coupled' ) THEN     ! add to the total freshwater budget 
     723!!         IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) THEN     ! add to the total freshwater budget 
    740724!!            ! remove negative runoff 
    741725!!            zcumulpos = SUM( MAX( frcv(:,:,jpr_rnf), 0.e0 ) * e1t(:,:) * e2t(:,:) * tmask_i(:,:) )  
     
    819803            !                                                   ! ======================= ! 
    820804            !   
    821             IF( TRIM( cn_rcv_tau(2) ) == 'cartesian' ) THEN            ! 2 components on the sphere 
     805            IF( TRIM( sn_rcv_tau%clvref ) == 'cartesian' ) THEN        ! 2 components on the sphere 
    822806               !                                                       ! (cartesian to spherical -> 3 to 2 components) 
    823807               CALL geo2oce( frcv(:,:,jpr_itx1), frcv(:,:,jpr_ity1), frcv(:,:,jpr_itz1),   & 
     
    835819            ENDIF 
    836820            ! 
    837             IF( TRIM( cn_rcv_tau(3) ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid 
    838                !                                                       ! (geographical to local grid -> rotate the components) 
     821            IF( TRIM( sn_rcv_tau%clvor ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid 
     822               !                                                          ! (geographical to local grid -> rotate the components) 
    839823               CALL rot_rep( frcv(:,:,jpr_itx1), frcv(:,:,jpr_ity1), srcv(jpr_itx1)%clgrid, 'en->i', ztx )    
    840824               frcv(:,:,jpr_itx1) = ztx(:,:)      ! overwrite 1st component on the 1st grid 
     
    10541038      !                                                           ! solid precipitation  - sublimation       (emp_ice) 
    10551039      !                                                           ! solid Precipitation                      (sprecip) 
    1056       SELECT CASE( TRIM( cn_rcv_emp ) ) 
     1040      SELECT CASE( TRIM( sn_rcv_emp%cldes ) ) 
    10571041      CASE( 'conservative'  )   ! received fields: jpr_rain, jpr_snow, jpr_ievp, jpr_tevp 
    10581042         pemp_tot(:,:) = frcv(:,:,jpr_tevp) - frcv(:,:,jpr_rain) - frcv(:,:,jpr_snow) 
     
    11031087 
    11041088      !                                                      ! ========================= ! 
    1105       SELECT CASE( TRIM( cn_rcv_qns ) )                      !   non solar heat fluxes   !   (qns) 
     1089      SELECT CASE( TRIM( sn_rcv_qns%cldes ) )                !   non solar heat fluxes   !   (qns) 
    11061090      !                                                      ! ========================= ! 
    11071091      CASE( 'conservative' )                                      ! the required fields are directly provided 
     
    11401124 
    11411125      !                                                      ! ========================= ! 
    1142       SELECT CASE( TRIM( cn_rcv_qsr ) )                      !      solar heat fluxes    !   (qsr) 
     1126      SELECT CASE( TRIM( sn_rcv_qsr%cldes ) )                !      solar heat fluxes    !   (qsr) 
    11431127      !                                                      ! ========================= ! 
    11441128      CASE( 'conservative' ) 
     
    11571141      END SELECT 
    11581142 
    1159       SELECT CASE( TRIM( cn_rcv_dqnsdt ) ) 
     1143      SELECT CASE( TRIM( sn_rcv_dqnsdt%cldes ) ) 
    11601144      CASE ('coupled') 
    11611145          pdqns_ice(:,:,1) = frcv(:,:,jpr_dqnsdt) 
     
    11901174      !                                                      !    Surface temperature    !   in Kelvin 
    11911175      !                                                      ! ------------------------- ! 
    1192       SELECT CASE( cn_snd_temperature) 
     1176      SELECT CASE( sn_snd_temp%cldes ) 
    11931177      CASE( 'oce only'             )   ;   ztmp1(:,:) =   tn(:,:,1) + rt0 
    11941178      CASE( 'weighted oce and ice' )   ;   ztmp1(:,:) = ( tn(:,:,1) + rt0 ) * zfr_l(:,:)    
    11951179                                           ztmp2(:,:) =   tn_ice(:,:,1)     *  fr_i(:,:) 
    11961180      CASE( 'mixed oce-ice'        )   ;   ztmp1(:,:) = ( tn(:,:,1) + rt0 ) * zfr_l(:,:) + tn_ice(:,:,1) * fr_i(:,:) 
    1197       CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of cn_snd_temperature' ) 
     1181      CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp' ) 
    11981182      END SELECT 
    11991183      IF( ssnd(jps_toce)%laction )   CALL cpl_prism_snd( jps_toce, isec, ztmp1, info ) 
     
    12371221         !                                                              i-1  i   i 
    12381222         !                                                               i      i+1 (for I) 
    1239          SELECT CASE( TRIM( cn_snd_crt(1) ) ) 
     1223         SELECT CASE( TRIM( sn_snd_crt%cldes ) ) 
    12401224         CASE( 'oce only'             )      ! C-grid ==> T 
    12411225            DO jj = 2, jpjm1 
     
    13181302         ! 
    13191303         ! 
    1320          IF( TRIM( cn_snd_crt(3) ) == 'eastward-northward' ) THEN             ! Rotation of the components 
     1304         IF( TRIM( sn_snd_crt%clvor ) == 'eastward-northward' ) THEN              ! Rotation of the components 
    13211305            !                                                                     ! Ocean component 
    13221306            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->e', ztmp1 )       ! 1st component  
     
    13331317         ! 
    13341318         ! spherical coordinates to cartesian -> 2 components to 3 components 
    1335          IF( TRIM( cn_snd_crt(2) ) == 'cartesian' ) THEN 
     1319         IF( TRIM( sn_snd_crt%clvref ) == 'cartesian' ) THEN 
    13361320            ztmp1(:,:) = zotx1(:,:)                     ! ocean currents 
    13371321            ztmp2(:,:) = zoty1(:,:) 
Note: See TracChangeset for help on using the changeset viewer.