Skip to content

Commit cf2c0fa

Browse files
authored
Read standard parameter ancillary data in NetCDF (#324)
# CABLE ## Description Fixes #281 Aside from `climate` parameters, BIOS ancillary data is being read from the gridinfo. They are supposed to be read via a separate BLAZE NetCDF file #392 The original 0.5 degree gridinfo file ([`gridinfo_CSIRO_CRU05x05_4tiles.nc`](https://github.com/CABLE-LSM/bios_testing/blob/b45e0736cfd7fd1de1014319eb551b924542a96c/cable.nml#L4C63-L4C96)) went through 2 stages to make it compatible with reading to ancillary inputs TODO: Once these PRs are merged, point to these specific files 1. Subsampling at 0.05 degrees using script CABLE-LSM/gists#3 2. Add BIOS coastal remapping script for gridinfo to have the same mask for all input parameters. CABLE-LSM/gists#4 ## Type of change New feature ## Testing Run `act9test` and `1000pts-configuration` (TODO: provide links) to `BIOS_ancillary_netcdf` and `CABLE_POP-TRENDY` with `derived_parameters` and `check_parameter_values` being called after `cable_load_bios_params` instead of within `load_parameters`.
2 parents 2f3ff3e + 675dcee commit cf2c0fa

File tree

6 files changed

+43
-448
lines changed

6 files changed

+43
-448
lines changed

offline/cable_LUC_EXPT.F90

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ MODULE CABLE_LUC_EXPT
33
use cable_common_module, only: is_leapyear, leap_day, handle_err, handle_iostat,&
44
get_dimid, LatNames, LonNames, TimeNames
55
use cable_io_vars_module, only: logn, land_x, land_y, landpt, latitude, longitude
6+
USE cable_common_module, ONLY: cable_user
67
use cable_def_types_mod, only: mland
78

89
implicit none
@@ -67,13 +68,14 @@ MODULE CABLE_LUC_EXPT
6768

6869
! ------------------------------------------------------------------
6970

70-
SUBROUTINE LUC_EXPT_INIT(LUC_EXPT)
71+
SUBROUTINE LUC_EXPT_INIT(inMVG, LUC_EXPT)
7172

7273
use netcdf, only: nf90_open, nf90_nowrite, nf90_inq_varid, nf90_inq_dimid, &
7374
nf90_inquire_dimension, nf90_inq_varid, nf90_get_att, nf90_get_var, nf90_close
7475

7576
implicit none
7677

78+
INTEGER, INTENT(IN) :: inMVG(:, :)
7779
type(luc_expt_type), intent(inout) :: luc_expt
7880

7981
REAL :: tmp
@@ -379,6 +381,12 @@ SUBROUTINE LUC_EXPT_INIT(LUC_EXPT)
379381
PrimOnly_fID = -1
380382
ENDIF
381383

384+
IF (TRIM(cable_user%MetType) .EQ. "bios") THEN
385+
DO k = 1, mland
386+
LUC_EXPT%biome(k) = inMVG(landpt(k)%ilon,landpt(k)%ilat)
387+
ENDDO
388+
END IF
389+
382390
! Determine woody fraction (forest and shrub cover).
383391
call get_woody_fraction(LUC_EXPT)
384392

@@ -457,14 +465,12 @@ end subroutine luc_expt_zero
457465
subroutine get_woody_fraction(LUC_EXPT)
458466
! Determine woody fraction (forest and shrub cover) from ancillary data.
459467

460-
use cable_bios_met_obs_params, only: cable_bios_load_biome
461468
use cable_common_module, only: cable_user
462469

463470
implicit none
464471

465472
type(LUC_EXPT_type), intent(inout) :: LUC_EXPT
466473
real :: CPC(mland)
467-
integer :: MVG(mland)
468474
real :: projection_factor
469475

470476
if (TRIM(cable_user%MetType) .EQ. "bios") then
@@ -473,10 +479,8 @@ subroutine get_woody_fraction(LUC_EXPT)
473479
! Woody fraction (woodfrac) is then calculated from CPC.
474480

475481
! read bios parameter file to NVIS Major Vegetation Group "biomes"
476-
call cable_bios_load_biome(MVG)
477482

478483
! adjust fraction woody cover based on Major Vegetation Group
479-
LUC_EXPT%biome = MVG
480484
LUC_EXPT%ivegp = 2
481485
projection_factor = 0.65
482486
WHERE (LUC_EXPT%biome .eq. 1)
@@ -665,21 +669,17 @@ END SUBROUTINE LUC_EXPT_SET_TILES
665669
! ------------------------------------------------------------------
666670

667671

668-
SUBROUTINE LUC_EXPT_SET_TILES_BIOS(inVeg, inPfrac, LUC_EXPT )
669-
670-
USE cable_bios_met_obs_params, ONLY: cable_bios_load_fracC4
672+
SUBROUTINE LUC_EXPT_SET_TILES_BIOS(inVeg, inPfrac, infracC4, LUC_EXPT )
671673

672674
IMPLICIT NONE
673675

674676
INTEGER, INTENT(INOUT) :: inVeg(:,:,:)
675677
REAL, INTENT(INOUT) :: inPFrac(:,:,:)
676-
TYPE (LUC_EXPT_TYPE), INTENT(INOUT) :: LUC_EXPT
678+
REAL, INTENT(IN) :: infracC4(:,:)
679+
TYPE (LUC_EXPT_TYPE), INTENT(IN) :: LUC_EXPT
677680

678-
REAL :: fracC4(mland)
679681
INTEGER :: k, m, n
680682

681-
CALL cable_bios_load_fracC4(fracC4)
682-
683683
DO k=1, mland
684684
m = landpt(k)%ilon
685685
n = landpt(k)%ilat
@@ -691,7 +691,7 @@ SUBROUTINE LUC_EXPT_SET_TILES_BIOS(inVeg, inPfrac, LUC_EXPT )
691691
inPFrac(m,n,2:3) = 0.0
692692
inPFrac(m,n,1) = 1.0
693693
if ( LUC_EXPT%grass(k) .gt. 0.01 ) then
694-
if (fracC4(k).gt.0.5) then
694+
if (infracC4(m, n).gt.0.5) then
695695
inVeg(m,n,2) = 7 ! C4 grass
696696
else
697697
inVeg(m,n,2) = 6 ! C3 grass
@@ -704,7 +704,7 @@ SUBROUTINE LUC_EXPT_SET_TILES_BIOS(inVeg, inPfrac, LUC_EXPT )
704704

705705
inVeg(m,n,1) = LUC_EXPT%ivegp(k)
706706
inVeg(m,n,2) = LUC_EXPT%ivegp(k)
707-
if (fracC4(k).gt.0.5) then
707+
if (infracC4(m, n).gt.0.5) then
708708
inVeg(m,n,3) = 7 ! C4 grass
709709
else
710710
inVeg(m,n,3) = 6 ! C3 grass

0 commit comments

Comments
 (0)