Changeset 39


Ignore:
Timestamp:
08/29/12 15:23:39 (12 years ago)
Author:
smasson
Message:

fix in sbccpl when there is no sea-ice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r38 r39  
    378378      END SELECT 
    379379      ! 
    380       IF( TRIM( sn_rcv_tau%clvref ) == 'spherical' )   &           ! spherical: 3rd component not received 
     380      IF( TRIM( sn_rcv_tau%clvref ) == 'spherical'  )   &         ! spherical: 3rd component not received 
    381381         &     srcv( (/jpr_otz1, jpr_otz2, jpr_itz1, jpr_itz2/) )%laction = .FALSE.  
     382      ! 
     383      IF( TRIM( sn_rcv_tau%clvor  ) == 'local grid' ) THEN        ! already on local grid -> no need of the second grid 
     384            srcv(jpr_otx2:jpr_otz2)%laction = .FALSE.  
     385            srcv(jpr_itx2:jpr_itz2)%laction = .FALSE.  
     386            srcv(jpr_oty1)%clgrid = srcv(jpr_oty2)%clgrid   ! not needed but cleaner... 
     387            srcv(jpr_ity1)%clgrid = srcv(jpr_ity2)%clgrid   ! not needed but cleaner... 
     388      ENDIF 
    382389      ! 
    383390      IF( TRIM( sn_rcv_tau%cldes ) /= 'oce and ice' ) THEN        ! 'oce and ice' case ocean stress on ocean mesh used 
     
    562569 
    563570      SELECT CASE ( TRIM( sn_snd_thick%cldes ) ) 
    564       CASE ( 'ice and snow' )  
     571      CASE( 'none'         )       ! nothing to do 
     572      CASE( 'ice and snow' )  
    565573         ssnd(jps_hice:jps_hsnw)%laction = .TRUE. 
    566574         IF ( TRIM( sn_snd_thick%clcat ) == 'yes' ) THEN 
     
    568576         ELSE 
    569577            IF ( jpl > 1 ) THEN 
    570                CALL ctl_stop( 'sbc_cpl_init: use weighted ice and snow option for sn_snd_thick%cldes if not exchanging category fields' ) 
     578CALL ctl_stop( 'sbc_cpl_init: use weighted ice and snow option for sn_snd_thick%cldes if not exchanging category fields' ) 
    571579            ENDIF 
    572580         ENDIF 
    573       CASE ( 'weighted ice and snow' )  
     581      CASE( 'weighted ice and snow' )  
    574582         ssnd(jps_hice:jps_hsnw)%laction = .TRUE. 
    575583         IF ( TRIM( sn_snd_thick%clcat ) == 'yes' ) ssnd(jps_hice:jps_hsnw)%nct = jpl 
     
    13501358      !                                                      !    Surface temperature    !   in Kelvin 
    13511359      !                                                      ! ------------------------- ! 
    1352       SELECT CASE( sn_snd_temp%cldes) 
    1353       CASE( 'oce only'             )   ;   ztmp1(:,:) =   tsn(:,:,1,jp_tem) + rt0 
    1354       CASE( 'weighted oce and ice' )   ;   ztmp1(:,:) = ( tsn(:,:,1,jp_tem) + rt0 ) * zfr_l(:,:)    
    1355          SELECT CASE( sn_snd_temp%clcat ) 
    1356          CASE( 'yes' )    
    1357             ztmp3(:,:,1:jpl) = tn_ice(:,:,1:jpl) * a_i(:,:,1:jpl) 
    1358          CASE( 'no' ) 
    1359             ztmp3(:,:,:) = 0.0 
     1360      IF( ssnd(jps_toce)%laction .OR. ssnd(jps_tice)%laction .OR. ssnd(jps_tmix)%laction ) THEN 
     1361         SELECT CASE( sn_snd_temp%cldes) 
     1362         CASE( 'oce only'             )   ;   ztmp1(:,:) =   tsn(:,:,1,jp_tem) + rt0 
     1363         CASE( 'weighted oce and ice' )   ;   ztmp1(:,:) = ( tsn(:,:,1,jp_tem) + rt0 ) * zfr_l(:,:)    
     1364            SELECT CASE( sn_snd_temp%clcat ) 
     1365            CASE( 'yes' )    
     1366               ztmp3(:,:,1:jpl) = tn_ice(:,:,1:jpl) * a_i(:,:,1:jpl) 
     1367            CASE( 'no' ) 
     1368               ztmp3(:,:,:) = 0.0 
     1369               DO jl=1,jpl 
     1370                  ztmp3(:,:,1) = ztmp3(:,:,1) + tn_ice(:,:,jl) * a_i(:,:,jl) 
     1371               ENDDO 
     1372            CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%clcat' ) 
     1373            END SELECT 
     1374         CASE( 'mixed oce-ice'        )    
     1375            ztmp1(:,:) = ( tsn(:,:,1,1) + rt0 ) * zfr_l(:,:)  
    13601376            DO jl=1,jpl 
    1361                ztmp3(:,:,1) = ztmp3(:,:,1) + tn_ice(:,:,jl) * a_i(:,:,jl) 
     1377               ztmp1(:,:) = ztmp1(:,:) + tn_ice(:,:,jl) * a_i(:,:,jl) 
    13621378            ENDDO 
    1363          CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%clcat' ) 
     1379         CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%cldes' ) 
    13641380         END SELECT 
    1365       CASE( 'mixed oce-ice'        )    
    1366          ztmp1(:,:) = ( tsn(:,:,1,1) + rt0 ) * zfr_l(:,:)  
    1367          DO jl=1,jpl 
    1368             ztmp1(:,:) = ztmp1(:,:) + tn_ice(:,:,jl) * a_i(:,:,jl) 
    1369          ENDDO 
    1370       CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%cldes' ) 
    1371       END SELECT 
    1372       IF( ssnd(jps_toce)%laction )   CALL cpl_prism_snd( jps_toce, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 
    1373       IF( ssnd(jps_tice)%laction )   CALL cpl_prism_snd( jps_tice, isec, ztmp3, info ) 
    1374       IF( ssnd(jps_tmix)%laction )   CALL cpl_prism_snd( jps_tmix, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 
     1381         IF( ssnd(jps_toce)%laction )   CALL cpl_prism_snd( jps_toce, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 
     1382         IF( ssnd(jps_tice)%laction )   CALL cpl_prism_snd( jps_tice, isec, ztmp3, info ) 
     1383         IF( ssnd(jps_tmix)%laction )   CALL cpl_prism_snd( jps_tmix, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 
     1384      ENDIF 
    13751385      ! 
    13761386      !                                                      ! ------------------------- ! 
     
    13921402      !                                                      ! ------------------------- ! 
    13931403      ! Send ice fraction field  
    1394       SELECT CASE( sn_snd_thick%clcat ) 
    1395          CASE( 'yes' )    
    1396             ztmp3(:,:,1:jpl) =  a_i(:,:,1:jpl) 
    1397          CASE( 'no' ) 
    1398             ztmp3(:,:,1) = fr_i(:,:) 
    1399       CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 
    1400       END SELECT 
    1401       IF( ssnd(jps_fice)%laction ) CALL cpl_prism_snd( jps_fice, isec, ztmp3, info ) 
     1404      IF( ssnd(jps_fice)%laction ) THEN 
     1405         SELECT CASE( sn_snd_thick%clcat ) 
     1406         CASE( 'yes' )   ;   ztmp3(:,:,1:jpl) =  a_i(:,:,1:jpl) 
     1407         CASE( 'no'  )   ;   ztmp3(:,:,1    ) = fr_i(:,:      ) 
     1408         CASE default    ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 
     1409         END SELECT 
     1410         CALL cpl_prism_snd( jps_fice, isec, ztmp3, info ) 
     1411      ENDIF 
    14021412 
    14031413      ! Send ice and snow thickness field  
    1404       SELECT CASE( sn_snd_thick%cldes) 
    1405       CASE( 'weighted ice and snow' )    
    1406          SELECT CASE( sn_snd_thick%clcat ) 
    1407          CASE( 'yes' )    
    1408             ztmp3(:,:,1:jpl) =  ht_i(:,:,1:jpl) * a_i(:,:,1:jpl) 
    1409             ztmp4(:,:,1:jpl) =  ht_s(:,:,1:jpl) * a_i(:,:,1:jpl) 
    1410          CASE( 'no' ) 
    1411             ztmp3(:,:,:) = 0.0   ;  ztmp4(:,:,:) = 0.0 
    1412             DO jl=1,jpl 
    1413                ztmp3(:,:,1) = ztmp3(:,:,1) + ht_i(:,:,jl) * a_i(:,:,jl) 
    1414                ztmp4(:,:,1) = ztmp4(:,:,1) + ht_s(:,:,jl) * a_i(:,:,jl) 
    1415             ENDDO 
    1416          CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 
     1414      IF( ssnd(jps_hice)%laction .OR. ssnd(jps_hsnw)%laction ) THEN  
     1415         SELECT CASE( sn_snd_thick%cldes) 
     1416         CASE( 'none'                  )       ! nothing to do 
     1417         CASE( 'weighted ice and snow' )    
     1418            SELECT CASE( sn_snd_thick%clcat ) 
     1419            CASE( 'yes' )    
     1420               ztmp3(:,:,1:jpl) =  ht_i(:,:,1:jpl) * a_i(:,:,1:jpl) 
     1421               ztmp4(:,:,1:jpl) =  ht_s(:,:,1:jpl) * a_i(:,:,1:jpl) 
     1422            CASE( 'no' ) 
     1423               ztmp3(:,:,:) = 0.0   ;  ztmp4(:,:,:) = 0.0 
     1424               DO jl=1,jpl 
     1425                  ztmp3(:,:,1) = ztmp3(:,:,1) + ht_i(:,:,jl) * a_i(:,:,jl) 
     1426                  ztmp4(:,:,1) = ztmp4(:,:,1) + ht_s(:,:,jl) * a_i(:,:,jl) 
     1427               ENDDO 
     1428            CASE default                  ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 
     1429            END SELECT 
     1430         CASE( 'ice and snow'         )    
     1431            ztmp3(:,:,1:jpl) = ht_i(:,:,1:jpl) 
     1432            ztmp4(:,:,1:jpl) = ht_s(:,:,1:jpl) 
     1433         CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%cldes' ) 
    14171434         END SELECT 
    1418       CASE( 'ice and snow'         )    
    1419          ztmp3(:,:,1:jpl) = ht_i(:,:,1:jpl) 
    1420          ztmp4(:,:,1:jpl) = ht_s(:,:,1:jpl) 
    1421       CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%cldes' ) 
    1422       END SELECT 
    1423       IF( ssnd(jps_hice)%laction )   CALL cpl_prism_snd( jps_hice, isec, ztmp3, info ) 
    1424       IF( ssnd(jps_hsnw)%laction )   CALL cpl_prism_snd( jps_hsnw, isec, ztmp4, info ) 
     1435         IF( ssnd(jps_hice)%laction )   CALL cpl_prism_snd( jps_hice, isec, ztmp3, info ) 
     1436         IF( ssnd(jps_hsnw)%laction )   CALL cpl_prism_snd( jps_hsnw, isec, ztmp4, info ) 
     1437      ENDIF 
    14251438      ! 
    14261439#if defined key_cpl_carbon_cycle 
Note: See TracChangeset for help on using the changeset viewer.