Open penguian opened 4 years ago
@mgk576@nci.org.au commented
Fixes are here:
https://trac.nci.org.au/trac/cable/browser/branches/Users/mgk576/trunk
@mgk576@nci.org.au commented
Further additions are required to allow Pdep and Ndep to be passed via the met file. Doing this allows site runs to easily set their own inputs without altering the core functionality of the model (i.e. pre-processing) and allows users to replicate recent MIPs (e.g. FACE). The main changes are in cable_input.f90, fixes are also here: https://trac.nci.org.au/trac/cable/browser/branches/Users/mgk576/trunk
e.g.
! Look for Ndep
ok = NF90_INQ_VARID(ncid_met,'Ndep',id%Ndep)
IF(ok == NF90_NOERR) THEN ! If inquiry is okay
exists%Ndep = .TRUE. ! Ndep is present in met file
! Get Ndep units:
ok = NF90_GET_ATT(ncid_met,id%Ndep,'units',metunits%Ndep)
IF(ok /= NF90_NOERR) CALL nc_abort &
(ok,'Error finding Ndep units in met data file ' &
_TRIM(filename%met)_' (SUBROUTINE open_met_file)')
IF(metunits%Ndep(1:10)/='gN/m^2/d^1') THEN
WRITE(*,*) metunits%Ndep, metunits%Ndep(1:10)
CALL abort('Unknown units for Ndep'// &
' in '_TRIM(filename%met)_' (SUBROUTINE open_met_data)')
END IF
ELSE ! Ndep not present
exists%Ndep = .FALSE. ! Ndep is not present in met file
all_met=.FALSE. ! not all met variables are present in file
! Note this in log file:
WRITE(logn,*) 'Ndep not present in met file'
END IF
! Look for Pdep
ok = NF90_INQ_VARID(ncid_met,'Pdep',id%Pdep)
IF(ok == NF90_NOERR) THEN ! If inquiry is okay
exists%Pdep = .TRUE. ! Ndep is present in met file
! Get Ndep units:
ok = NF90_GET_ATT(ncid_met,id%Pdep,'units',metunits%Pdep)
IF(ok /= NF90_NOERR) CALL nc_abort &
(ok,'Error finding Ndep units in met data file ' &
_TRIM(filename%met)_' (SUBROUTINE open_met_file)')
IF(metunits%Pdep(1:10)/='gP/m^2/d^1') THEN
WRITE(*,*) metunits%Pdep
CALL abort('Unknown units for Pdep'// &
' in '_TRIM(filename%met)_' (SUBROUTINE open_met_data)')
END IF
ELSE ! Pdep not present
exists%Pdep = .FALSE. ! Pdep is not present in met file
all_met=.FALSE. ! not all met variables are present in file
! Note this in log file:
WRITE(logn,*) 'Pdep not present in met file'
END IF
and
! Get Ndep data for mask grid:- - - - - - - - - - - - - - - - - -
IF(exists%Ndep) THEN ! If Ndep exists in met file
ok= NF90_GET_VAR(ncid_met,id%Ndep,tmpDat4, &
start=(/1,1,1,ktau/),count=(/xdimsize,ydimsize,1,1/))
IF(ok /= NF90_NOERR) CALL nc_abort &
(ok,'Error reading Ndep in met data file ' &
_TRIM(filename%met)_' (SUBROUTINE get_met_data)')
DO i=1,mland ! over all land points/grid cells
met%ndep(landpt(i)%cstart:landpt(i)%cend) = &
REAL(tmpDat4(land_x(i),land_y(i),1,1))
ENDDO
! gN m-2 d-1
casaflux%Nmindep = met%ndep
END IF
! Get Pdep data for mask grid:- - - - - - - - - - - - - - - - - -
IF(exists%Pdep) THEN ! If Ndep exists in met file
ok= NF90_GET_VAR(ncid_met,id%Pdep,tmpDat4, &
start=(/1,1,1,ktau/),count=(/xdimsize,ydimsize,1,1/))
IF(ok /= NF90_NOERR) CALL nc_abort &
(ok,'Error reading Pdep in met data file ' &
_TRIM(filename%met)_' (SUBROUTINE get_met_data)')
DO i=1,mland ! over all land points/grid cells
met%pdep(landpt(i)%cstart:landpt(i)%cend) = &
REAL(tmpDat4(land_x(i),land_y(i),1,1))
ENDDO
! gP m-2 d-1
casaflux%Pdep = met%pdep
END IF
This also requires "casaflux" being passed to "get_met_data"
@mgk576@nci.org.au changed _comment0 which not transferred by tractive
@mgk576@nci.org.au changed _comment1 which not transferred by tractive
@mgk576@nci.org.au changed _comment2 which not transferred by tractive
@mgk576@nci.org.au changed _comment3 which not transferred by tractive
@mgk576@nci.org.au commented
Two further tickets are also relevant:
https://trac.nci.org.au/trac/cable/ticket/237 (needed for spin up)
https://trac.nci.org.au/trac/cable/ticket/238 (needed to stop confusing people)
@mgk576@nci.org.au changed _comment0 which not transferred by tractive
@jxs599@nci.org.au set milestone to 6. Report
@mgk576@nci.org.au commented
This ticket is also problematic...
@ccc561@nci.org.au set keywords to keepgit
keyword_keepgit
owner:yxw599@nci.org.au
type_defect
| by mgk576To get CASA to work in the trunk further fixes are needed.
Firstly (https://trac.nci.org.au/trac/cable/ticket/227).
In addition:
in cable_driver.F90, around line 851, below the comment "! WRITE CASA OUTPUT" ... this fix generates output files which currently are not written. There might be a better fix, Jhan do you understand the timestep stuff?
Finally, in casa_cnp.F90. YP's branch has this catch for non-physical behaviour. This hasn't made it across into the trunk. I'm not sure why it would be worth asking Vanessa if she feels it is unnecessary. Either way, I see no reason not to have it as it would only be used in erroneous scenarios so shouldn't mess anyone's simulations up.
Issue migrated from trac:228 at 2023-11-27 11:29:59 +1100