Changeset 7810


Ignore:
Timestamp:
2017-03-20T11:39:41+01:00 (4 years ago)
Author:
jcastill
Message:

Make sure that all the fields read from a wave model contain valid information, even if the land/sea masks of the wave and the ocean model do not match

Location:
branches/UKMO/r6232_INGV1_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/r6232_INGV1_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90

    r7793 r7810  
    226226         IF( jpfld > 0 ) THEN                            ! Read from file only if the field is not coupled 
    227227            CALL fld_read( kt, nn_fsbc, sf_sd )          ! read wave parameters from external forcing 
    228             IF( jp_hsw > 0 )   hsw  (:,:) = sf_sd(jp_hsw)%fnow(:,:,1)   ! significant wave height 
    229             IF( jp_wmp > 0 )   wmp  (:,:) = sf_sd(jp_wmp)%fnow(:,:,1)   ! wave mean period 
    230             IF( jp_usd > 0 )   ut0sd(:,:) = sf_sd(jp_usd)%fnow(:,:,1)   ! 2D zonal Stokes Drift at T point 
    231             IF( jp_vsd > 0 )   vt0sd(:,:) = sf_sd(jp_vsd)%fnow(:,:,1)   ! 2D meridional Stokes Drift at T point 
     228            IF( jp_hsw > 0 ) THEN 
     229               hsw  (:,:) = sf_sd(jp_hsw)%fnow(:,:,1)   ! significant wave height 
     230               WHERE( hsw > 100.0 ) hsw = 0.0 
     231               WHERE( hsw <   0.0 ) hsw = 0.0 
     232            ENDIF 
     233            IF( jp_wmp > 0 ) THEN 
     234               wmp  (:,:) = sf_sd(jp_wmp)%fnow(:,:,1)   ! wave mean period 
     235               WHERE( wmp > 100.0 ) wmp = 0.0 
     236               WHERE( wmp <   0.0 ) wmp = 0.0 
     237            ENDIF 
     238            IF( jp_usd > 0 ) THEN   
     239               ut0sd(:,:) = sf_sd(jp_usd)%fnow(:,:,1)   ! 2D zonal Stokes Drift at T point 
     240               WHERE( ut0sd < -100.0 ) ut0sd = 1.0 
     241               WHERE( ut0sd >  100.0 ) ut0sd = 1.0 
     242            ENDIF 
     243            IF( jp_vsd > 0 ) THEN   
     244               vt0sd(:,:) = sf_sd(jp_vsd)%fnow(:,:,1)   ! 2D meridional Stokes Drift at T point 
     245               WHERE( vt0sd < -100.0 ) vt0sd = 1.0 
     246               WHERE( vt0sd >  100.0 ) vt0sd = 1.0 
     247            ENDIF 
    232248         ENDIF 
    233249         ! 
     
    285301         IF( .NOT. cpl_wdrag ) THEN 
    286302            ALLOCATE( sf_cd(1), STAT=ierror )           !* allocate and fill sf_wave with sn_cdg 
    287             IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave_init: unable to allocate sf_wave structure' ) 
     303            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave_init: unable to allocate sf_cd structure' ) 
    288304            ! 
    289305                                   ALLOCATE( sf_cd(1)%fnow(jpi,jpj,1)   ) 
     
    297313         IF( .NOT. cpl_tauoc ) THEN 
    298314            ALLOCATE( sf_tauoc(1), STAT=ierror )           !* allocate and fill sf_wave with sn_tauoc 
    299             IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave_init: unable to allocate sf_wave structure' ) 
     315            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave_init: unable to allocate sf_tauoc structure' ) 
    300316            ! 
    301317                                    ALLOCATE( sf_tauoc(1)%fnow(jpi,jpj,1)   ) 
     
    334350            IF( jp_wmp > 0 )   slf_i(jp_wmp) = sn_wmp 
    335351            ALLOCATE( sf_sd(jpfld), STAT=ierror )   !* allocate and fill sf_sd with stokes drift 
    336             IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave_init: unable to allocate sf_wave structure' ) 
     352            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave_init: unable to allocate sf_sd structure' ) 
    337353            ! 
    338354            DO ifpr= 1, jpfld 
     
    354370         IF( ln_zdfqiao .AND. .NOT.cpl_wnum ) THEN 
    355371            ALLOCATE( sf_wn(1), STAT=ierror )           !* allocate and fill sf_wave with sn_wnum 
    356             IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave_init: unable toallocate sf_wave structure' ) 
     372            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave_init: unable toallocate sf_wn structure' ) 
    357373                                   ALLOCATE( sf_wn(1)%fnow(jpi,jpj,1)   ) 
    358374            IF( sn_wnum%ln_tint )  ALLOCATE( sf_wn(1)%fdta(jpi,jpj,1,2) ) 
  • branches/UKMO/r6232_INGV1_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90

    r7481 r7810  
    915915      IF( nn_bc_surf < 0 .OR. nn_bc_surf > 1 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_bc_surf is 0 or 1' )  
    916916      IF( nn_z0_met < 0 .OR. nn_z0_met > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_z0_met is 0, 1, 2 or 3' )  
    917       IF( nn_z0_met == 3 .AND. .NOT.ln_wave ) CALL ctl_stop( 'zdf_gls_init: nn_z0_met=3 requires ln_wave=T' )  
     917      IF( nn_z0_met == 3 .AND. .NOT.ln_sdw ) CALL ctl_stop( 'zdf_gls_init: nn_z0_met=3 requires ln_sdw=T' )  
    918918      IF( nn_stab_func  < 0 .OR. nn_stab_func  > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_stab_func is 0, 1, 2 and 3' )  
    919919      IF( nn_clos       < 0 .OR. nn_clos       > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_clos is 0, 1, 2 or 3' ) 
Note: See TracChangeset for help on using the changeset viewer.