Opened 4 months ago

Closed 2 months ago

#2564 closed Bug (fixed)

ORCA2 tracer damping hand edits in dtatsd.F90 can be cumulatively applied

Reported by: hadcv Owned by: hadcv
Priority: low Milestone: Unscheduled
Component: DOM Version: trunk
Severity: minor Keywords: dtatsd, orca2, tra_dmp
Cc: Branch review: failed
MP ready?: no Task progress: Unspecified

Description (last modified by nemo)

Issue

When running ORCA2 with tracer damping and without temporal interpolation, i.e.

[namelist:namtra_dmp]
ln_tradmp=.true.

[namelist:namtsd]
sn_tem='data_1m_potential_temperature_nomask',-1.0,'votemper',.false.,.true.,'yearly','','',''

the model tends to blow up with near-freezing temperatures in the Alboran Sea.

Cause

The following ORCA2 hand edits in dtatsd.F90 seem to be applied on each timestep:

148         !
149         !!gm  This should be removed from the code   ===>>>>  T & S files has to be changed
150         !
151         !                                   !==   ORCA_R2 configuration and T & S damping   ==!
152         IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN
153            IF( nn_cfg == 2 .AND. ln_tsd_dmp ) THEN    ! some hand made alterations
154               !
155               ij0 = 101 + nn_hls       ;   ij1 = 109 + nn_hls                       ! Reduced T & S in the Alboran Sea
156               ii0 = 141 + nn_hls - 1   ;   ii1 = 155 + nn_hls - 1
157               DO jj = mj0(ij0), mj1(ij1)
158                  DO ji = mi0(ii0), mi1(ii1)
159                     sf_tsd(jp_tem)%fnow(ji,jj,13:13) = sf_tsd(jp_tem)%fnow(ji,jj,13:13) - 0.20_wp
160                     sf_tsd(jp_tem)%fnow(ji,jj,14:15) = sf_tsd(jp_tem)%fnow(ji,jj,14:15) - 0.35_wp
161                     sf_tsd(jp_tem)%fnow(ji,jj,16:25) = sf_tsd(jp_tem)%fnow(ji,jj,16:25) - 0.40_wp
162                     !
163                     sf_tsd(jp_sal)%fnow(ji,jj,13:13) = sf_tsd(jp_sal)%fnow(ji,jj,13:13) - 0.15_wp
164                     sf_tsd(jp_sal)%fnow(ji,jj,14:15) = sf_tsd(jp_sal)%fnow(ji,jj,14:15) - 0.25_wp
165                     sf_tsd(jp_sal)%fnow(ji,jj,16:17) = sf_tsd(jp_sal)%fnow(ji,jj,16:17) - 0.30_wp
166                     sf_tsd(jp_sal)%fnow(ji,jj,18:25) = sf_tsd(jp_sal)%fnow(ji,jj,18:25) - 0.35_wp
167                  END DO
168               END DO
169               ij0 =  87 + nn_hls       ;   ij1 =  96 + nn_hls                       ! Reduced temperature in Red Sea
170               ii0 = 148 + nn_hls - 1   ;   ii1 = 160 + nn_hls - 1
171               sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ,  4:10 ) = 7.0_wp
172               sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 11:13 ) = 6.5_wp
173               sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 14:20 ) = 6.0_wp
174            ENDIF
175         ENDIF
176         !!gm end

I gather that this is because sf_tsd(jp_tem)%fnow is only updated once per record when temporal interpolation is not used.

Solution

Check to see if the record number has changed (implying new data has been read in):

  • (a) before vs. (b) after

    a b  
    11        IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN 
    22           IF( nn_cfg == 2 .AND. ln_tsd_dmp ) THEN    ! some hand made alterations 
     3              irec_n(jp_tem) = sf_tsd(jp_tem)%nrec(2,sf_tsd(jp_tem)%naa)            ! Determine if there is new data (ln_tint = F) 
     4              irec_n(jp_sal) = sf_tsd(jp_sal)%nrec(2,sf_tsd(jp_sal)%naa)            ! If not, then do not apply the increments 
     5              IF( kt == nit000 ) irec_b(:) = -1 
    36              ! 
    47              ij0 = 101 + nn_hls       ;   ij1 = 109 + nn_hls                       ! Reduced T & S in the Alboran Sea 
    58              ii0 = 141 + nn_hls - 1   ;   ii1 = 155 + nn_hls - 1 
    69              DO jj = mj0(ij0), mj1(ij1) 
    710                 DO ji = mi0(ii0), mi1(ii1) 
     11                    IF( sf_tsd(jp_tem)%ln_tint .OR. irec_n(jp_tem) /= irec_b(jp_tem) ) THEN 
    812                       sf_tsd(jp_tem)%fnow(ji,jj,13:13) = sf_tsd(jp_tem)%fnow(ji,jj,13:13) - 0.20_wp 
    913                       sf_tsd(jp_tem)%fnow(ji,jj,14:15) = sf_tsd(jp_tem)%fnow(ji,jj,14:15) - 0.35_wp 
    1014                       sf_tsd(jp_tem)%fnow(ji,jj,16:25) = sf_tsd(jp_tem)%fnow(ji,jj,16:25) - 0.40_wp 
     15                       irec_b(jp_tem) = irec_n(jp_tem) 
     16                    ENDIF 
    1117                    ! 
     18                    IF( sf_tsd(jp_sal)%ln_tint .OR. irec_n(jp_sal) /= irec_b(jp_sal) ) THEN 
    1219                       sf_tsd(jp_sal)%fnow(ji,jj,13:13) = sf_tsd(jp_sal)%fnow(ji,jj,13:13) - 0.15_wp 
    1320                       sf_tsd(jp_sal)%fnow(ji,jj,14:15) = sf_tsd(jp_sal)%fnow(ji,jj,14:15) - 0.25_wp 
    1421                       sf_tsd(jp_sal)%fnow(ji,jj,16:17) = sf_tsd(jp_sal)%fnow(ji,jj,16:17) - 0.30_wp 
    1522                       sf_tsd(jp_sal)%fnow(ji,jj,18:25) = sf_tsd(jp_sal)%fnow(ji,jj,18:25) - 0.35_wp 
     23                       irec_b(jp_sal) = irec_n(jp_sal) 
     24                    ENDIF 
    1625                 END DO 
    1726              END DO 
    1827              ij0 =  87 + nn_hls       ;   ij1 =  96 + nn_hls                       ! Reduced temperature in Red Sea 
    1928              ii0 = 148 + nn_hls - 1   ;   ii1 = 160 + nn_hls - 1 
    2029              sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ,  4:10 ) = 7.0_wp 
    2130              sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 11:13 ) = 6.5_wp 
    2231              sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 14:20 ) = 6.0_wp 
    2332           ENDIF 

Commit History (2)

ChangesetAuthorTimeChangeLog
14186hadcv2020-12-16T11:32:26+01:00

#2564: Fix ORCA2 hand edits in dta_tsd being applied cumulatively

14185hadcv2020-12-16T11:32:22+01:00

#2564: Fix ORCA2 hand edits in dta_tsd being applied cumulatively

Change History (8)

comment:1 Changed 3 months ago by hadcv

  • Description modified (diff)
  • Owner changed from systeam to hadcv
  • Status changed from new to assigned

comment:2 Changed 3 months ago by hadcv

  • Description modified (diff)

comment:3 Changed 3 months ago by hadcv

  • Description modified (diff)

comment:4 Changed 3 months ago by hadcv

  • Description modified (diff)

comment:5 Changed 3 months ago by nemo

  • Description modified (diff)

comment:6 Changed 2 months ago by hadcv

In 14185:

#2564: Fix ORCA2 hand edits in dta_tsd being applied cumulatively

comment:7 Changed 2 months ago by hadcv

In 14186:

#2564: Fix ORCA2 hand edits in dta_tsd being applied cumulatively

comment:8 Changed 2 months ago by hadcv

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.