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 15634 – NEMO

Changeset 15634


Ignore:
Timestamp:
2022-01-12T11:44:02+01:00 (2 years ago)
Author:
hadjt
Message:

TRA/tradwl.F90 BUG FIX

The over-stratification problem I was having was due to a bug in the TRA/tradwl.F90 code.

Enda looked through my namelist, and made some suggestsion which could be causing the error. I ran a series of tests to see if any caused the error (none did).

By comparing output.namelist.dyn between my run and Enda's, I found some additional differences, so I ran some additional test.

I found namelist:namtrd ln_tra_trd was causing the problem. Setting it to .false. fixed it.

Somewhere, ln_tra_trd = .true. was causing the problem.

ln_tra_trd is defined in trd_oce.F90
read in from the name list in trdini.F90, and is queried in trdtra, where it is used to call trd_tra_iom.
The only other place its used in (my version of) nemo is in trdini.F90, where it sets l_trdtra = True...

l_trdtra is all over NEMO, in 20 F90 files.

However, I noted l_trdtra is also in tradwl.F90 that I implemented. Looking l_trdtra in tradwl, it looked suspicious. The call to the trends functions had been commented out by CEOD, and it used pointers (pointing to ua and va as temp space??) to store changes to T and S. So as well as not reporting the changes, they could be overwriting the ua and va fields (the "after" 3d u and v velocity).

I have commented out these sections of code. At a later date, it may be useful to add them back in, in a way that is consistent with NEMO4, but it has not been done here.

--

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE/TRA/tradwl.F90

    r15445 r15634  
    7070      !! 
    7171      !!---------------------------------------------------------------------- 
    72       USE oce, ONLY :   ztrdt => ua   ! use ua as 3D workspace    
    73       USE oce, ONLY :   ztrds => va   ! use va as 3D workspace    
     72 
     73      !JT USE oce, ONLY :   ztrdt => ua   ! use ua as 3D workspace    
     74      !JT USE oce, ONLY :   ztrds => va   ! use va as 3D workspace    
     75 
    7476      !! 
    7577      INTEGER, INTENT(in) ::   kt     ! ocean time-step 
     
    103105      ENDIF 
    104106 
    105       IF( l_trdtra ) THEN      ! Save ta and sa trends 
    106          ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
    107          ztrds(:,:,:) = 0.e0 
    108       ENDIF 
     107      !JT IF( l_trdtra ) THEN      ! Save ta and sa trends 
     108      !JT    ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
     109      !JT    ztrds(:,:,:) = 0.e0 
     110      !JT ENDIF 
    109111!-------------------------------------------------------------------- 
    110112!  Set transmissivity 
     
    198200 
    199201 
    200       IF( l_trdtra ) THEN     ! qsr tracers trends saved for diagnostics 
    201          ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 
    202          !CEODCALL trd_mod( ztrdt, ztrds, jptra_trd_qsr, 'TRA', kt ) 
    203       ENDIF 
     202      !JT IF( l_trdtra ) THEN     ! qsr tracers trends saved for diagnostics 
     203      !JT    ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 
     204      !JT    !CEODCALL trd_mod( ztrdt, ztrds, jptra_trd_qsr, 'TRA', kt ) 
     205      !JT ENDIF 
    204206      !                       ! print mean trends (used for debugging) 
    205207      IF(ln_ctl)   CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' qsr  - Ta: ', mask1=tmask, clinfo3='tra-ta' ) 
Note: See TracChangeset for help on using the changeset viewer.