Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Declare a variable in Solve_em.F

MSdueon12

Member
Dear modeler,

I want to declare a varaible in solve_em.F, this variable is a temparory variable that is not outputed. My declaration is
REAL, DIMENSION (kds:kde) :: tr2_massflux
and I got an error that says:
A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association
I thought it may be due to the kds and kde has not called yet, but in module_bc_em.F, for example, there are some variables that are decleared without any CALLs. (for example:
REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), INTENT(INOUT) :: field
REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), INTENT(IN ) :: field_tend, ph_save)



I also have tried to declare this variable after CALLs, and I also got another error:
A specification statement cannot appear in the executable section.
so I am really confused what is the error, and how can I correct this error?

Please find my wrong code as a attachemnt, I added the declaration just following the other declarations at the beginning of the file. Also, tried after the two CALLs and got the executable errors mentioned above.

Really appreciate your help.
 

Attachments

  • solve_em.F
    253 KB · Views: 1
This is actually a Fortran issue. Note that all variables in solve_em.F are passed into the code through "grid". grid%dt is time step, grid%t_phy is temperature, etc. Your cannot define variables as shown in your code. Please take a look at the document:
This file describes how Registry works in WRF, including how to add new variables. Hope this is helpful for you.
 
Top