ana_tclima.h incomplete code, also for DOUBLE_GYRE

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
MoeinDst
Posts: 9
Joined: Tue Nov 22, 2022 5:31 pm
Location: University of Genoa
Contact:

ana_tclima.h incomplete code, also for DOUBLE_GYRE

#1 Unread post by MoeinDst »

Hello fellow ROMS users, and developers.

I stumbled upon an issue in the ana_tclima.h that does not work as intended. It has the DOUBLE_GYRE example from ROMS test-cases but even for this does not work since it misses some definitions I presume. In the original analytical climatology we have:

Code: Select all

#if defined DOUBLE_GYRE
        val1=(44.69_r8/39.382_r8)**2
        val2=val1*(rho0*100.0_r8/g)*                                    &
     &       (5.0E-5_r8/((42.689_r8/44.69_r8)**2))
        DO k=1,N(ng)
          DO j=JstrT,JendT
            DO i=IstrT,IendT
              val3=T0(ng)+val2*EXP(GRID(ng)%z_r(i,j,k)/100.0_r8)*       &
     &             (10.0_r8-0.4_r8*TANH(GRID(ng)%z_r(i,j,k)/100.0_r8))
              val4=GRID(ng)%yr(i,j)/el(ng)
              CLIMA(ng)%tclm(i,j,k,itemp)=val3-3.0_r8*val4
However, the z_r variable is not defined/declared in any line and also the grid info cannot be read since the mod_grid is not used, so cannot access the GRID structure. Then in the ana_tclima_tile the z_r is absent which is required for climatology computations.
Anyways, I came up with some modifications that now works just fine for me that I share here. But be aware that I'm no Fortran expert!

The modified lines in the version that works for me are:

Code: Select all

!
      USE mod_param
      USE mod_grid
      USE mod_ncparam
!
! Imported variable declarations.
!
      integer, intent(in) :: ng, tile, model
!
!  Local variable declarations.
!
      character (len=*), parameter :: MyFile =                          &
     &  __FILE__
!
#include "tile.h"
!
#ifdef SOLVE3D
      CALL ana_tclima_tile (ng, tile, model,                            &
     &                      LBi, UBi, LBj, UBj,                         &
     &                      IminS, ImaxS, JminS, JmaxS,                 &
     &                      GRID(ng) % z_r)
#else
      CALL ana_tclima_tile (ng, tile, model,                            &
     &                      LBi, UBi, LBj, UBj,                         &
     &                      IminS, ImaxS, JminS, JmaxS,                 &
     &                      GRID(ng) % h)
#endif
and

Code: Select all

!***********************************************************************
      SUBROUTINE ana_tclima_tile (ng, tile, model,                      &
     &                            LBi, UBi, LBj, UBj,                   &
     &                            IminS, ImaxS, JminS, JmaxS,           &
#ifdef SOLVE3D
     &                            z_r)
#else
     &                            h)
#endif
!***********************************************************************
Cheers.
Attachments
ana_tclima_original.h
(4.28 KiB) Downloaded 1 time
ana_tclima_mine.h
(4.95 KiB) Downloaded 1 time

Post Reply