- Timestamp:
- 2017-12-01T05:41:32+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90
r7753 r8865 876 876 ELSE !* Initialize at "rest" 877 877 ! 878 IF( ln_wd .AND. ( cn_cfg == 'wad' ) ) THEN 878 879 ! MJB ln_rwd edits start here - these are essential 880 881 IF( (ln_wd .OR. ln_rwd)) THEN 882 879 883 ! Wetting and drying test case 880 CALL usr_def_istate( gdept_b, tmask, tsb, ub, vb, sshb ) 881 tsn (:,:,:,:) = tsb (:,:,:,:) ! set now values from to before ones 882 sshn (:,:) = sshb(:,:) 883 un (:,:,:) = ub (:,:,:) 884 vn (:,:,:) = vb (:,:,:) 885 ! uniform T-S fields and initial ssh slope 886 ! needs to be called here and in istate which is called later. 887 ! Adjust vertical metrics 884 IF( cn_cfg == 'wad' ) THEN 885 CALL usr_def_istate( gdept_b, tmask, tsb, ub, vb, sshb ) 886 tsn (:,:,:,:) = tsb (:,:,:,:) ! set now values from to before ones 887 sshn (:,:) = sshb(:,:) 888 un (:,:,:) = ub (:,:,:) 889 vn (:,:,:) = vb (:,:,:) 890 ELSEIF( ln_wd .or. ln_rwd ) THEN ! if not test case 891 sshn(:,:) = -rn_ssh_ref 892 sshb(:,:) = -rn_ssh_ref 893 894 DO jj = 1, jpj 895 DO ji = 1, jpi 896 IF( ht_0(ji,jj)-rn_ssh_ref < rn_wdmin1 ) THEN ! if total depth is less than min depth 897 898 sshb(ji,jj) = rn_wdmin1 - (ht_0(ji,jj) ) 899 sshn(ji,jj) = rn_wdmin1 - (ht_0(ji,jj) ) 900 ssha(ji,jj) = rn_wdmin1 - (ht_0(ji,jj) ) 901 ENDIF 902 ENDDO 903 ENDDO 904 ENDIF !If wad elseif ln_wd or ln_rwd 905 906 ! Adjust vertical metrics for all wad 888 907 DO jk = 1, jpk 889 e3t_n(:,:,jk) = e3t_0(:,:,jk) * ( ht_0(:,:) + sshn(:,:)) &890 & / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk) &891 & + e3t_0(:,:,jk) * (1._wp -tmask(:,:,jk))908 e3t_n(:,:,jk) = e3t_0(:,:,jk) * ( ht_0(:,:) - rn_ht_0 + sshn(:,:) ) & 909 & / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk) & 910 & + e3t_0(:,:,jk) * (1._wp -tmask(:,:,jk)) 892 911 END DO 893 912 e3t_b(:,:,:) = e3t_n(:,:,:) 894 ! 895 ELSEIF( ln_wd ) THEN 896 ! 897 DO jj = 1, jpj 898 DO ji = 1, jpi 899 IF( e3t_0(ji,jj,1) <= 0.5_wp * rn_wdmin1 ) THEN 900 ! potential bug 901 ! Warning this assumes 2 layers only over wetting locations. needs investigating 902 e3t_b(ji,jj,:) = 0.5_wp * rn_wdmin1 903 e3t_n(ji,jj,:) = 0.5_wp * rn_wdmin1 904 e3t_a(ji,jj,:) = 0.5_wp * rn_wdmin1 905 sshb(ji,jj) = rn_wdmin1 - ht_wd(ji,jj) !!gm I don't understand that ! 906 sshn(ji,jj) = rn_wdmin1 - ht_wd(ji,jj) 907 ssha(ji,jj) = rn_wdmin1 - ht_wd(ji,jj) 908 ENDIF 909 ENDDO 910 ENDDO 913 914 DO ji = 1, jpi 915 DO jj = 1, jpj 916 IF ( ht_0(ji,jj) .LE. 0.0 .AND. NINT(ssmask(ji,jj)) .EQ. 1) THEN 917 CALL ctl_stop( 'dom_vvl_rst: ht_0 must be positive at potentially wet points' ) 918 ENDIF 919 END DO 920 END DO 921 911 922 ! 912 923 ELSE
Note: See TracChangeset
for help on using the changeset viewer.