EDmodel / ED2

Ecosystem Demography Model
78 stars 112 forks source link

Issue reading xml file into older ED2 version (~r81) #90

Closed serbinsh closed 9 years ago

serbinsh commented 9 years ago

I am hitting an issue using an ED2 version I was able to run a few years back. I am calling this revision number 81 ( @rgknox edition). This is the version I ran the initial runs looking at tweaking optical parameters, based on some modifications Ryan had made to the code. I am trying to run this version again on our new server but have run into a problem when loading the XML config with options set by PEcAn. Basically the issue is with the path length. If I set NL%IEDCNFGF = 'config.xml' then ED2 will load it and run, but if I use the full path (/data/sserbin/Modeling/ED2_Modeling/US-WCr/PEcAn.US-WCr/ED2.r81.run/pecan/run/SA-median/config.xml) for example it will error out with:

+--- Parallel info: -------------------------------------+
+  - Machnum  =      0
+  - Machsize =      1
+--------------------------------------------------------+
Reading namelist information
Copying namelist
+------------------------------------------------------------+
|           Ecosystem Demography Model, version 2.2
+------------------------------------------------------------+
|  Input namelist filename is ED2IN
|
|  Single process execution on INITIAL run.
+------------------------------------------------------------+
  => Generating the land/sea mask.
/data/Data/Model_Data/ED2data/ED2drivers/EDI/oge2OLD/OGE2_HEADER
 -> Getting file: /data/Data/Model_Data/ED2data/ED2drivers/EDI/oge2OLD/OGE2_30N120W.h5...
 -> Getting file: /data/Data/Model_Data/ED2data/ED2drivers/EDI/oge2OLD/OGE2_30N090W.h5...
 + Work allocation, node     1;
 + Polygon array allocation, node     1;
 + Memory successfully allocated on none     1;
 [+] Load_Ed_Ecosystem_Params...
 [+] Checking for XML config...

 ============================================
 Counting PFT(s) in XML: /data/sserbin/Modeling/ED2_Modeling/US-WCr/PEcAn.US-WCr/ED2.r81.run/pecan/run/SA-median/config.xml
 Found            3  PFT tags
 MAXPFT =           11
 Opening ED2 XML Config file/data/sserbin/Modeling/ED2_Modeling/US-WCr/PEcAn.US-WCr/ED2.r81.run/pecan/run/SA-median/config.xml
 ERROR STOP IN LINKLIST: THERE IS NO LIST CALLED: /data/sserbin/Modeling/ED2_Modeling/US-WCr/PEcAn.US-WCr/ED2.r81.run/pecan/run/SA-median/config.xml

I assume there is a spot where I can tweak the character length for the path, is that correct? I would just like to get this running so I can compare with recent tweaks to the ED2 model.

@mdietze @Viskari

serbinsh commented 9 years ago

Just to show it works with a short path:

+------------------------------------------------------------+
|  Input namelist filename is ED2IN
|
|  Single process execution on INITIAL run.
+------------------------------------------------------------+
  => Generating the land/sea mask.
/data/Data/Model_Data/ED2data/ED2drivers/EDI/oge2OLD/OGE2_HEADER
 -> Getting file: /data/Data/Model_Data/ED2data/ED2drivers/EDI/oge2OLD/OGE2_30N120W.h5...
 -> Getting file: /data/Data/Model_Data/ED2data/ED2drivers/EDI/oge2OLD/OGE2_30N090W.h5...
 + Work allocation, node     1;
 + Polygon array allocation, node     1;
 + Memory successfully allocated on none     1;
 [+] Load_Ed_Ecosystem_Params...
 [+] Checking for XML config...

 ============================================
 Counting PFT(s) in XML: config.xml
 Found            3  PFT tags
 MAXPFT =           11
 Opening ED2 XML Config fileconfig.xml
 EXTERN READ FROM FILE ::           0
 MISC READ FROM FILE ::           0
 ED_MISC READ FROM FILE ::           1
 PFT's READ FROM FILE ::           3
Reading pft SLA=    42.804468
Reading pft leaf_trans_vis=     0.103909
Reading pft leaf_trans_nir=     0.305167
Reading pft leaf_reflect_vis=     0.104914
Reading pft leaf_reflect_nir=     0.155069
Reading pft Vm0=    56.371743
Reading pft q=     0.636280
Reading pft plant_min_temp=   -80.000000
Reading pft stomatal_slope=     6.157351
Reading pft growth_resp_factor=     0.350008
Reading pft r_fract=     0.310811
Reading pft dark_respiration_factor=     0.015000
Reading pft mort2=    19.933670
Reading pft quantum_efficiency=     0.057312
Reading pft root_turnover_rate=     1.286510
Reading pft storage_turnover_rate=     0.000000
Reading pft root_respiration_factor=     1.398307
Reading pft water_conductance=   600.000000
           1           9 temperate.Early_Hardwood.optics SLA:    42.8044662
           1           9 temperate.Early_Hardwood.optics Vm0:    56.3717422
           1           9 temperate.Early_Hardwood.optics quantum_eff.:    5.73122762E-02
           1           9 temperate.Early_Hardwood.optics Stomatal Slope:    6.15735054
           1           9 temperate.Early_Hardwood.optics Rd0:    0.00000000
           1           9 temperate.Early_Hardwood.optics root_respiration_factor:    1.39830673
           1           9 temperate.Early_Hardwood.optics clumping_factor:   0.83999999999999997
           1           9 temperate.Early_Hardwood.optics leaf_reflect_vis:   0.10491382275358800
           1           9 temperate.Early_Hardwood.optics leaf_reflect_nir:   0.15506939151906399
           1           9 temperate.Early_Hardwood.optics leaf_trans_vis:   0.10390858307248001
           1           9 temperate.Early_Hardwood.optics leaf_trans_nir:   0.30516712416429098
...
serbinsh commented 9 years ago
module ll_module
  type ll_type
     character(32)            :: LL_ID
     character(32)            :: TAG
     character(32)            :: ID
     character(1),dimension(:),pointer :: VALUE
!     real(8),dimension(:),pointer     :: row
     type(ll_type),pointer    :: NEXT_LL
     type(ll_type),pointer    :: FIRST_TAG
     type(ll_type),pointer    :: NEXT_TAG
     type(ll_type),pointer    :: UP_TAG
     type(ll_type),pointer    :: DOWN_TAG
     type(ll_type),pointer    :: FIRST_ID
     type(ll_type),pointer    :: NEXT_ID
     type(ll_type),pointer    :: NEXT_PID
  end type ll_type

  type(ll_type),pointer       :: LL_ROOT
  type(ll_type),pointer       :: THIS,THISTEMP,THISTMP1

  logical(4)                  :: INITIALIZED=.false.
  logical(4)                  :: TCASESENSITIVE=.true.

I think it may be this bit. Changing LL_ID, TAG, and ID to great than 32

mdietze commented 9 years ago

@serbinsh this is the same bug in ED/src/utils/libxml2f90.f90_pp.f90 that we've fixed a million times (and which is FINALLY checked intp the mainline!). You should just be able to copy the mainline version of that file and everything should work.

Viskari commented 9 years ago

Quickly checking, I think, but am not completely certain, that this actually might be an issue with the compiler. I just remember that at a certain point I was having difficulties running on geo there were some issues with some parts of the ED2 code was cut in the middle. If that is the case, I think there is a compiler flag you can use, but aside from that I don't think there is an easy answer.

On Wed, Jun 24, 2015 at 3:22 PM, Shawn P. Serbin notifications@github.com wrote:

module ll_module type ll_type character(32) :: LL_ID character(32) :: TAG character(32) :: ID character(1),dimension(:),pointer :: VALUE ! real(8),dimension(:),pointer :: row type(ll_type),pointer :: NEXT_LL type(ll_type),pointer :: FIRST_TAG type(ll_type),pointer :: NEXT_TAG type(ll_type),pointer :: UP_TAG type(ll_type),pointer :: DOWN_TAG type(ll_type),pointer :: FIRST_ID type(ll_type),pointer :: NEXT_ID type(ll_type),pointer :: NEXT_PID end type ll_type

type(ll_type),pointer :: LL_ROOT type(ll_type),pointer :: THIS,THISTEMP,THISTMP1

logical(4) :: INITIALIZED=.false. logical(4) :: TCASESENSITIVE=.true.

I think it may be this bit. Changing LL_ID, TAG, and ID to great than 32

— Reply to this email directly or view it on GitHub https://github.com/EDmodel/ED2/issues/90#issuecomment-114985757.

serbinsh commented 9 years ago

@mdietze

Done.

Any reason we leave TAG and ID at a 32 character limit? I guess it may be unlikely to have such a large character size.

serbinsh commented 9 years ago

@Viskari I think it is the character limit issue that, as @mdietze has said, we have fixed it a million times. I am recompiling now and testing. I think it will work OK now

serbinsh commented 9 years ago

Fixed.

mdietze commented 9 years ago

@serbinsh there's no reason to leave TAG at 32 char. As you note, this isn't pressing because we don't have any tags that are longer than this