-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
379 continue integrating the ground water hydrology work into cable #411
base: main
Are you sure you want to change the base?
Changes from 74 commits
1b7e2e3
d1b5994
e9644f5
17650c5
f73518c
10b7550
ee4fb6b
8f354a0
5288555
c3b7559
17a3a16
43af9ee
8d73320
d03d07f
8b98ec2
d9d19aa
b5f25af
d6f92d7
68f930e
2aeeb40
9955e81
936acf8
230feec
86f4bf4
64dd7c3
9e9ca6f
d9d7356
a828802
4b41852
038d38f
c23ecf8
98b6673
0143f33
d3af980
1d974ae
2b61c5e
b2c4937
aa8997c
e0ec557
97d732e
09d966a
b0e1cd1
f1676aa
c5b30b1
e4f4288
274d8ff
ee3bb16
30b3938
fe52788
49aaddc
29917d2
f817a7e
38ce564
5679ede
1c3e8a4
03accf9
f61c2a0
6d955ed
eb04b08
f3a262c
7bb3f32
1fd7ce4
878fe12
91a67ff
844fc2a
c51b50e
8014bf9
30e55b6
68ccad5
0a79bcd
68e4658
4ca6929
4eb9a1a
34b1b77
1fe7734
d3e39e1
a7a1c9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ PROGRAM cable_offline_driver | |
USE cable_def_types_mod | ||
USE cable_IO_vars_module, ONLY: logn,gswpfile,ncciy,leaps, & | ||
verbose, fixedCO2,output,check,patchout, & | ||
patch_type,landpt,soilparmnew,& | ||
patch_type,landpt,soilparmnew, & | ||
defaultLAI, sdoy, smoy, syear, timeunits, exists, calendar, set_group_output_values, & | ||
NO_CHECK | ||
USE casa_ncdf_module, ONLY: is_casa_time | ||
|
@@ -245,7 +245,7 @@ PROGRAM cable_offline_driver | |
NAMELIST/CABLE/ & | ||
filename, & ! TYPE, containing input filenames | ||
vegparmnew, & ! use new soil param. method | ||
soilparmnew, & ! use new soil param. method | ||
soilparmnew, & ! use new soil param. method | ||
calcsoilalbedo, & ! albedo considers soil color Ticket #27 | ||
spinup, & ! spinup model (soil) to steady state | ||
delsoilM,delsoilT,& ! | ||
|
@@ -409,7 +409,8 @@ PROGRAM cable_offline_driver | |
! STOP 'casaCNP required to get prognostic LAI or Vcmax' | ||
IF( l_vcmaxFeedbk .AND. icycle < 1 ) & | ||
STOP 'icycle must be 2 to 3 to get prognostic Vcmax' | ||
IF( icycle > 0 .AND. ( .NOT. soilparmnew ) ) & | ||
|
||
IF( icycle > 0 .AND. ( .NOT. soilparmnew ) ) & | ||
STOP 'casaCNP must use new soil parameters' | ||
|
||
NRRRR = MERGE(MAX(CABLE_USER%CASA_NREP,1), 1, CASAONLY) | ||
|
@@ -512,6 +513,38 @@ PROGRAM cable_offline_driver | |
kend = ktauday * LOY | ||
ENDIF | ||
|
||
! __________________________ MMY using Princeton _______________________________ | ||
ELSE IF ( TRIM(cable_user%MetType) .EQ. 'prin' ) THEN | ||
ncciy = CurYear | ||
|
||
CALL prepareFiles_princeton(ncciy) ! MMY | ||
IF ( RRRR .EQ. 1 ) THEN | ||
CALL open_met_file( dels, koffset, kend, spinup, CTFRZ ) | ||
IF (leaps.and.is_leapyear(YYYY).and.kend.eq.2920) THEN | ||
STOP 'LEAP YEAR INCOMPATIBILITY WITH INPUT MET !' | ||
ENDIF | ||
IF ( NRRRR .GT. 1 ) THEN | ||
GSWP_MID(1,YYYY) = ncid_rain | ||
! GSWP_MID(2,YYYY) = ncid_snow MMY | ||
GSWP_MID(3,YYYY) = ncid_lw | ||
GSWP_MID(4,YYYY) = ncid_sw | ||
GSWP_MID(5,YYYY) = ncid_ps | ||
GSWP_MID(6,YYYY) = ncid_qa | ||
GSWP_MID(7,YYYY) = ncid_ta | ||
GSWP_MID(8,YYYY) = ncid_wd | ||
ENDIF | ||
ELSE | ||
ncid_rain = GSWP_MID(1,YYYY) | ||
! ncid_snow = GSWP_MID(2,YYYY) MMY | ||
ncid_lw = GSWP_MID(3,YYYY) | ||
ncid_sw = GSWP_MID(4,YYYY) | ||
ncid_ps = GSWP_MID(5,YYYY) | ||
ncid_qa = GSWP_MID(6,YYYY) | ||
ncid_ta = GSWP_MID(7,YYYY) | ||
ncid_wd = GSWP_MID(8,YYYY) | ||
kend = ktauday * LOY ! MMY | ||
ENDIF | ||
|
||
ELSE IF ( TRIM(cable_user%MetType) .EQ. 'plum' ) THEN | ||
! PLUME experiment setup using WATCH | ||
IF ( CALL1 ) THEN | ||
|
@@ -1049,9 +1082,17 @@ PROGRAM cable_offline_driver | |
YYYY.EQ. CABLE_USER%YearEnd ) THEN | ||
|
||
! evaluate spinup | ||
! =================== MMY_phase2 commented out this region in favor of the one below - rk4417 ===================== | ||
IF( ANY( ABS(ssnow%wb-soilMtemp)>delsoilM).OR. & | ||
ANY( ABS(ssnow%tgg-soilTtemp)>delsoilT) .OR. & | ||
MAXVAL(ABS(ssnow%GWwb-GWtemp),dim=1) > delgwM) THEN | ||
ANY( ABS(ssnow%tgg-soilTtemp)>delsoilT) .OR. & | ||
MAXVAL(ABS(ssnow%GWwb-GWtemp),dim=1) > delgwM) THEN | ||
|
||
! =================== MMY_phase2 uncomment ===================== | ||
! IF( (ANY( ABS(ssnow%wb-soilMtemp)>delsoilM).OR. & | ||
! ANY( ABS(ssnow%tgg-soilTtemp)>delsoilT) .or. & | ||
! maxval(ABS(ssnow%GWwb-GWtemp),dim=1) > delgwM) .and. & | ||
! ( (int(ktau_tot/kend) .lt. cable_user%max_spins) .and.& | ||
! (cable_user%max_spins .gt. 0) ) ) THEN | ||
|
||
! No complete convergence yet | ||
PRINT *, 'ssnow%wb : ', ssnow%wb | ||
|
@@ -1185,7 +1226,7 @@ PROGRAM cable_offline_driver | |
|
||
IF (icycle > 0.and. .not.l_landuse) THEN | ||
|
||
!CALL casa_poolout( ktau, veg, soil, casabiome, & | ||
!CALL casa_poolout( ktau, veg, soil, casabiome, & | ||
! casapool, casaflux, casamet, casabal, phen ) | ||
CALL write_casa_restart_nc ( casamet, casapool,casaflux,phen, CASAONLY ) | ||
|
||
|
@@ -1307,6 +1348,50 @@ SUBROUTINE renameFiles(logn,inFile,ncciy,inName) | |
|
||
END SUBROUTINE renameFiles | ||
|
||
|
||
! 2 subroutines below inserted by rk4417 - phase2 | ||
! _______________________ MMY for Princeton input ______________________________ | ||
SUBROUTINE prepareFiles_princeton(ncciy) | ||
USE cable_IO_vars_module, ONLY: logn,gswpfile | ||
IMPLICIT NONE | ||
INTEGER, INTENT(IN) :: ncciy | ||
|
||
WRITE(logn,*) 'CABLE offline global run using princeton forcing for ', ncciy | ||
PRINT *, 'CABLE offline global run using princeton forcing for ', ncciy | ||
|
||
CALL renameFiles_princeton(logn,gswpfile%rainf,ncciy,'rainf') | ||
CALL renameFiles_princeton(logn,gswpfile%LWdown,ncciy,'LWdown') | ||
CALL renameFiles_princeton(logn,gswpfile%SWdown,ncciy,'SWdown') | ||
CALL renameFiles_princeton(logn,gswpfile%PSurf,ncciy,'PSurf') | ||
CALL renameFiles_princeton(logn,gswpfile%Qair,ncciy,'Qair') | ||
CALL renameFiles_princeton(logn,gswpfile%Tair,ncciy,'Tair') | ||
CALL renameFiles_princeton(logn,gswpfile%wind,ncciy,'wind') | ||
|
||
END SUBROUTINE prepareFiles_princeton | ||
|
||
SUBROUTINE renameFiles_princeton(logn,inFile,ncciy,inName) | ||
IMPLICIT NONE | ||
INTEGER, INTENT(IN) :: logn,ncciy | ||
INTEGER:: nn | ||
CHARACTER(LEN=200), INTENT(INOUT) :: inFile | ||
CHARACTER(LEN=*), INTENT(IN) :: inName | ||
INTEGER :: idummy | ||
|
||
nn = INDEX(inFile,'19') | ||
READ(inFile(nn:nn+3),'(i4)') idummy | ||
WRITE(inFile(nn:nn+3),'(i4.4)') ncciy | ||
nn = INDEX(inFile,'19') | ||
READ(inFile(nn:nn+3),'(i4)') idummy | ||
WRITE(inFile(nn:nn+3),'(i4.4)') ncciy | ||
Comment on lines
+1380
to
+1385
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is it doing twice the same thing? Is there any explanation anywhere of what this does? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I traced this back to the code from MMY (phase 1). The only explanation is what you see "MMY for Princeton input". It could be intentional or a simple duplication error. We can ping MMY about it of you like |
||
READ(inFile(nn-5:nn-2),'(i4)') idummy | ||
WRITE(inFile(nn-5:nn-2),'(i4.4)') ncciy | ||
WRITE(logn,*) TRIM(inName), ' global data from ', TRIM(inFile) | ||
|
||
END SUBROUTINE renameFiles_princeton | ||
|
||
! ______________________________________________________________________________ | ||
|
||
|
||
!============================================================================== | ||
! subroutine for reading LU input data, zeroing biomass in empty secondary forest tiles | ||
! and tranferring LUC-based age weights for secondary forest to POP structure | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't be done in the module definition part. This will require some more in-depth changes that will be done later.