**** DANGER: AS OF 5/31/2023, THESE UTILITIES ARE QUICK-AND-DIRTY ROUTINES THAT HARD-CODE THE GRID, FILE NAME, AND
***         THEY OVERWRITE THE INPUT FILE!!!! 
***         TEST ON COPIES OF NETCDF FILES AND NOT ON ORIGINAL FILES!!!
******************************************************************************************************************

These utilities allow to "extend" data beyond the normal land mask to the entire world.
No attempt was made to make the "pretty" - they just supposed to work.

extend_veg.f - extends land cover. Data is assumed to be missing if sum of all fractions for a particular cell is < 1.
extend_laimax_0.f - extends laimax data. Data is assumed to be missing if the value < 0.0001 .
extend_height_0.f - extends height data (and its std). Data is assumed to be missing if the value < 0.0001 .
extend_lai_0.f - extends LAI. Data is assumed to be missing if the sum of LAIs for particular PFT over the year is < 0.0001 .

The data is assumed to be provided in the files: veg.nc, laimax.nc, height.nc, lai.nc respectively. These files are overwritten with "extended" data, so make sure to make a copy before running these commands. 

The data is extended to the same latitude first and then to the neighbouring latitudes until the entire world is covered.

To compile each of the files, use something like:
5/31/2023: Suggested on discover:
set NETCDFHOME=/usr/local/other/netcdf4/4.7.2/gcc-9.2/
gfortran extend_veg_0.f -I $NETCDFHOME/include -L$NETCDFHOME/lib -lnetcdf -lnetcdff 

8/9/2024: Suggested on discover:
module purge
module load comp/intel/2021.4.0 mpi/impi/2021.4.0 netcdf-4.5.0_impi_intel-19.1.0.166
ifort extend_<var>.f -I $NETCDFHOME/include -L$NETCDFHOME/lib -lnetcdf -lnetcdff -o extend_<var>
To run:
./extend_<var> <any command line inputs>


