error compiling ana_lrflux

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
wtorres
Posts: 2
Joined: Wed Nov 30, 2016 11:18 pm
Location: Duke University

error compiling ana_lrflux

#1 Post by wtorres »

Hi there,

I am using COAWST on an idealized application where I would like to prescribe an analytic diurnal shortwave and longwave radiation flux, but seem to be getting a compilation error from ROMS (so I hope this question is appropriate here). I am able to compile and successfully run the model with the cppdefs

Code: Select all

#define ANA_SRFLUX
#define SOLAR_SOURCE
but when I try to include

Code: Select all

#define ANA_LRFLUX
the code will not compile, producing the following error
analytical.f90:681:46:

& FORCES(ng) % lrflx)
1
Error: ‘lrflx’ at (1) is not a member of the ‘t_forces’ structure
Is there a way around this error besides providing forcing via #BULK FLUXES? I've attached my header file for reference in case that is illuminating. Thanks in advance for the help!
Attachments
annulus.h
(1.85 KiB) Downloaded 62 times

jcwarner
Posts: 1015
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: error compiling ana_lrflux

#2 Post by jcwarner »

here is what's happening.
You defined solar_source, and in globaldefs there is :

#if defined LMD_SKPP || defined SOLAR_SOURCE || \
defined BULK_FLUXES || defined BIOLOGY
# define SHORTWAVE
#endif

so with shortwave now automatically defined, we go to mod_forces we have

# ifdef SHORTWAVE
real(r8), pointer :: srflx(:,:)
so the array srflx is active, all is good.


But for longwave the lrflx is not automatically set. In mod_forces we have

# ifdef BULK_FLUXES
real(r8), pointer :: lhflx(:,:)
real(r8), pointer :: lrflx(:,:)
# ifndef LONGWAVE
real(r8), pointer :: lrflxG(:,:,:)
...

this is the same in all the codes.

I am not sure the best way to solve the issue. Perhaps you could compute the total heat fluxes and use ana_stflux (itemp)??
-j

User avatar
kate
Posts: 3996
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: error compiling ana_lrflux

#3 Post by kate »

In my code, I added the option to have an analytic longwave flux for the ICE_BOX test case. See if you can copy what I did into COAWST to make it work if that's what you need. The sea ice needs the separate longwave and shortwave fluxes to compute its own bulk fluxes (if you are using sea ice).

Post Reply