I want to add a 3D mixing coefficient and input it to the model as a forcing parameter. I have defined it in mod_forces.F as follow,
Code: Select all
# ifdef ECOSIM
allocate ( FORCES(ng) % SpecIr(LBi:UBi,LBj:UBj,NBands) )
allocate ( FORCES(ng) % avcos(LBi:UBi,LBj:UBj,NBands) )
# endif
!=======================================================================
# ifdef WAVE_MIXING
allocate ( FORCES(ng) % bv(LBi:UBi,LBj:UBj,0:N(ng)) )
allocate ( FORCES(ng) % bvG(LBi:UBi,LBj:UBj,0:N(ng),2) )
# endif
!=======================================================================
#endif
#if defined TANGENT || defined TL_IOMS
!
! Tangent linear model state
!
allocate ( FORCES(ng) % tl_sustr(LBi:UBi,LBj:UBj) )
allocate ( FORCES(ng) % tl_svstr(LBi:UBi,LBj:UBj) )
Then I read in the data from forcing file in subroutine get_data.F as follow,
Code: Select all
# if !defined ANA_M3CLIMA && defined M3CLIMATOLOGY
CALL get_3dfld (ng, iNLM, idUclm, CLM(ng)%ncid, &
& 1, CLM(ng), update(1), &
& LBi, UBi, LBj, UBj, 1, N(ng), 2, 1, &
# ifdef MASKING
& GRID(ng) % umask(LBi,LBj), &
# endif
& CLIMA(ng) % uclmG(LBi,LBj,1,1))
IF (exit_flag.ne.NoError) RETURN
CALL get_3dfld (ng, iNLM, idVclm, CLM(ng)%ncid, &
& 1, CLM(ng), update(1), &
& LBi, UBi, LBj, UBj, 1, N(ng), 2, 1, &
# ifdef MASKING
& GRID(ng) % vmask(LBi,LBj), &
# endif
& CLIMA(ng) % vclmG(LBi,LBj,1,1))
IF (exit_flag.ne.NoError) RETURN
# endif
# endif
#endif
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#if defined SOLVE3D && defined WAVE_MIXING
CALL get_3dfld (ng, iNLM, idWbv, ncFRCid(idWbv,ng), &
& nFfiles(ng), FRC(1,ng), update(1), &
& LBi, UBi, LBj, UBj, 0, N(ng), 2, 1, &
# ifdef MASKING
& GRID(ng) % rmask(LBi,LBj), &
# endif
& FORCES(ng) % bvG(LBi,LBj,1,1))
IF (exit_flag.ne.NoError) RETURN
#endif
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
So it is wired for me.
But if I defined it as
Code: Select all
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# ifdef WAVE_MIXING
allocate ( FORCES(ng) % bv(LBi:UBi,LBj:UBj,N(ng)) )
allocate ( FORCES(ng) % bvG(LBi:UBi,LBj:UBj,N(ng),2) )
# endif
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
And read it with
Code: Select all
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#if defined SOLVE3D && defined WAVE_MIXING
CALL get_3dfld (ng, iNLM, idWbv, ncFRCid(idWbv,ng), &
& nFfiles(ng), FRC(1,ng), update(1), &
& LBi, UBi, LBj, UBj, 1, N(ng), 2, 1, &
# ifdef MASKING
& GRID(ng) % rmask(LBi,LBj), &
# endif
& FORCES(ng) % bvG(LBi,LBj,1,1))
IF (exit_flag.ne.NoError) RETURN
#endif
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I would like appreciate your any hint very much. Thanks.