Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Querying whether a given ivt is a crop

samrabin

Sam Rabin
Member
Is there a convenient way to do this? Currently I'm looping through 1 to mxpft, but I need to skip PFTs that aren't crops.
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
Although npcropmin is the first prognostic crop type, so it skips the two generic crops. I'll look for something else....
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
This seems a little clunky but this has been used:

if (lun%itype(patch%landunit(p)) == istcrop) then

This might be better:

use pftconMod , only :crop
crop => pftcon%crop , & ! Input: crop or not (0 =not crop and 1 = crop)
if(crop(patch%itype(p))== 0) then

It includes generic crops.
 

samrabin

Sam Rabin
Member
Excellent, thanks for the options! I'm going with npcropmin for now, because the work I'm doing doesn't really make sense for generic crops, but it's good to know all the possibilities.
 
Top