today i realized that i have found a little bug sometime ago, but only today i have seen that i do not reported it ( i think)
The bug: Looks like the options associated to output the variable Specific humidity and Air Temperature are missing in the whole code. I can see that this kind of variables are less important, since you already have it inside the forcing file, but , when using the internal interpolation and getting the data inside an station or averaged file, together with others fields are great ( e.g. for a time series plot u dont need to load the frc file , interp to the station locations and so on, just load them from your beloved sta.nc). Moreover, the options to save Uwind and Vwind are working, so why not Tair and Hair !?( Probably more variables are missing too ).
I will talk about the Hair variable, because its the most evident missing parts ( The Tair variable have some different missing parts inside the main code).
First:
The option to write the Specific humidity on the *.in files r missing ("idQair"). The mod_ncparam.F file have the entry for idQair, but there is no code to write the variable "Hair" in wrt_his.F, wrt_avg.F and wrt_station.F.
the code that should be inside wrt_his( and others) are very similar to Pair, except with the "idQair" and right cpp entries.
file wrt_his.F
#line 1035
Code: Select all
# if defined BULK_FLUXES || defined ECOSIM || defined ANA_HUMIDITY
!
! Write out surface air humidity.
!
IF (Hout(idQair,ng)) THEN
scale=1.0_r8
gtype=gfactor*r2dvar
status=nf_fwrite2d(ng, iNLM, HIS(ng)%ncid, HIS(ng)%Vid(idQair), &
& HIS(ng)%Rindex, gtype, &
& LBi, UBi, LBj, UBj, scale, &
# ifdef MASKING
& GRID(ng) % rmask_io, &
# endif
& FORCES(ng) % Hair)
IF (status.ne.nf90_noerr) THEN
IF (Master) THEN
WRITE (stdout,10) TRIM(Vname(1,idHair)), HIS(ng)%Rindex
END IF
exit_flag=3
ioerror=status
RETURN
END IF
END IF
# endif
file: def_his.F
#line 1193
Code: Select all
# if defined BULK_FLUXES || defined ECOSIM || defined ANA_HUMIDITY
!
! Define surface air humidity.
!
IF (Hout(idQair,ng)) THEN
Vinfo( 1)=Vname(1,idQair)
Vinfo( 2)=Vname(2,idQair)
Vinfo( 3)=Vname(3,idQair)
Vinfo(14)=Vname(4,idQair)
Vinfo(16)=Vname(1,idtime)
# if defined WRITE_WATER && defined MASKING
Vinfo(20)='mask_rho'
# endif
Vinfo(22)='coordinates'
Aval(5)=REAL(Iinfo(1,idQair,ng),r8)
status=def_var(ng, iNLM, HIS(ng)%ncid, HIS(ng)%Vid(idQair), &
& NF_FOUT, nvd3, t2dgrd, Aval, Vinfo, ncname)
IF (exit_flag.ne.NoError) RETURN
END IF
# endif
#line 2444
Code: Select all
# if defined BULK_FLUXES || defined ECOSIM || defined ANA_HUMIDITY
ELSE IF (TRIM(var_name(i)).eq.TRIM(Vname(1,idQair))) THEN
got_var(idQair)=.TRUE.
HIS(ng)%Vid(idQair)=var_id(i)
# endif
Code: Select all
# if defined BULK_FLUXES || defined ECOSIM || defined ANA_HUMIDITY
IF (.not.got_var(idQair).and.Hout(idQair,ng)) THEN
IF (Master) WRITE (stdout,60) TRIM(Vname(1,idQair)), &
& TRIM(ncname)
exit_flag=3
RETURN
END IF
# endif
file: inp_par.F
#line 2222
Code: Select all
# if defined BULK_FLUXES || defined ECOSIM || defined ANA_HUMIDITY
ELSE IF (TRIM(KeyWord).eq.'Hout(idQair)') THEN
IF (idQair.eq.0) THEN
IF (Master) WRITE (out,280) 'idQair'
exit_flag=5
RETURN
END IF
Npts=load_l(Nval, Cval, Ngrids, Hout(idQair,:))
# endif
At least, when i was checking if everything was ok, i have found a typo inside inp_par just below the new code and inside the directive associated to write Uwind and Vwind :
file: inp_par.F
#line 2231
Code: Select all
IF (idPair.eq.0) THEN
Code: Select all
IF (idVair.eq.0) THEN