# Get SIF canopy layer code into JULES trunk

**URL:** <https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728>\
**Category:** JULES\
**Created:** [22 September 2022 15:13 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728 "2022-09-22T15:13:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tquaife](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tquaife](https://cms-helpdesk.ncas.ac.uk/u/tquaife)\
**Post date:** [22 September 2022 15:13 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/1 "2022-09-22T15:13:01Z")

</div>

Hi Patrick  
Can you get the SIF canopy layer code accepted into the JULES trunk?  
Tristan

---

<div class="post-metadata">

**Author:** ![tquaife](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tquaife](https://cms-helpdesk.ncas.ac.uk/u/tquaife)\
**Post date:** [22 September 2022 15:13 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/2 "2022-09-22T15:13:44Z")

</div>

Hi Patrick,

My version of JULES with canopy layer outputs (and hence as a model dimension) is here:

/home/users/db903833/src/jules5.0/sif\_trunk (on RACC)

It appears to be JULES 5.0. I took my lead from here:

[https://jules-lsm.github.io/vn7.0/code/io.html#implementing-new-variables-for-input-and-output](https://jules-lsm.github.io/vn7.0/code/io.html#implementing-new-variables-for-input-and-output)

but I confess I can’t see the bit about adding new dimensions!

Cheers,  
Tristan.

---

<div class="post-metadata">

**Author:** ![tquaife](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tquaife](https://cms-helpdesk.ncas.ac.uk/u/tquaife)\
**Post date:** [22 September 2022 15:14 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/3 "2022-09-22T15:14:38Z")

</div>

ps - I note there are a bunch of changes in:  
src/io/model\_interface

to the following:  
model\_interface\_mod.F90  
extract\_var.inc  
get\_var\_levs\_dims.inc  
variable\_metadata.inc

I think it’s these bits that are the core changes needed outside of the “science” parts of the code.

Tristan

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [22 September 2022 15:15 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/4 "2022-09-22T15:15:18Z")

</div>

Hi Tristan:

I copied your code to JASMIN under /home/users/pmcguire/jules/RACC\_\_db903833\_\_src\_\_jules5.0\_\_sif\_trunk2

and I checked our JULES 5.0 with fcm checkout fcm:jules.x\_tr@vn5.0 and I put vn5.0 under /home/users/pmcguire/jules/jules-vn5.0

Then I did diff -r jules-vn5.0 RACC\_\_db903833\_\_src\_\_jules5.0\_\_sif\_trunk2

I see the differences.

Can I check your version into the MOSRS archive? Or have you already checked it in there or somewhere else?

I guess you already have an MOSRS account, as well.

Patrick

---

<div class="post-metadata">

**Author:** ![tquaife](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tquaife](https://cms-helpdesk.ncas.ac.uk/u/tquaife)\
**Post date:** [22 September 2022 15:16 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/5 "2022-09-22T15:16:02Z")

</div>

Hi Patrick,

> Can I check your version into the MOSRS archive?  
> Yes, please do.

> Or have you already checked it in there or somewhere else?  
> I have not.

> I guess you already have an MOSRS account, as well.  
> I do, but happy for you to own this.

Tristan.

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [22 September 2022 16:24 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/6 "2022-09-22T16:24:06Z")

</div>

Hi Tristan  
Thanks!

I have checked it in to MOSRS  
as [https://code.metoffice.gov.uk/svn/jules/main/branches/dev/patrickmcguire/vn5.0\_sif1](https://code.metoffice.gov.uk/svn/jules/main/branches/dev/patrickmcguire/vn5.0_sif1)

I think to get this code into the trunk, I will have to update it to the latest version of JULES, which I will do now.  
Patrick

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [23 September 2022 14:55 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/7 "2022-09-23T14:55:26Z")

</div>

Hi Tristan  
I started merging your vn5.0\_sif1 branch with the latest version of JULES (7.0). Not sure how long it will take me to merge this. There have been a lot of changes from JULES 5.0 to 7.0 in the trunk.  
Patrick

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [23 September 2022 14:57 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/8 "2022-09-23T14:57:05Z")

</div>

Hi Tristan:  
Do you have an example JULES suite that uses the vn5.0\_sif1 branch, which I can work on testing with my copy of this branch and for testing the porting from jules 5.0 to jules 7.0?  
Patrick

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [27 September 2022 21:43 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/9 "2022-09-27T21:43:54Z")

</div>

Hi Tristan:  
I have merged in the SIF changes you made in this JULES5.0 branch:  
[https://code.metoffice.gov.uk/svn/jules/main/branches/dev/patrickmcguire/vn5.0\_sif1](https://code.metoffice.gov.uk/svn/jules/main/branches/dev/patrickmcguire/vn5.0_sif1)  
into this JULES7.0 branch:  
[https://code.metoffice.gov.uk/svn/jules/main/branches/dev/patrickmcguire/vn7.0\_sif1](https://code.metoffice.gov.uk/svn/jules/main/branches/dev/patrickmcguire/vn7.0_sif1)

This is a first draft. I haven’t tried to compile it yet, so there are probably some things to fix.

There were a lot of differences in the snow code from JULES 5.0 trunk to the vn5.0\_sif1 branch. I am not sure if you made those changes or if you picked up the JULES 5.0 trunk after someone else made those snow changes. I didn’t replicate these vn5.0\_sif1 snow code changes in the vn7.0\_sif1 branch.

Do you have a JULES suite that I could use to test the vn5.0\_sif1 and vn7.0\_sif1 branches?  
Patrick

---

<div class="post-metadata">

**Author:** ![tquaife](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tquaife](https://cms-helpdesk.ncas.ac.uk/u/tquaife)\
**Post date:** [29 September 2022 11:15 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/10 "2022-09-29T11:15:31Z")

</div>

Hi Patrick,

Thanks for this.

I don’t have a suite to test those modifications, but if you clone a global suite forced by WFDEI (or WFDE5, or in fact, any reanalysis) and set it to output the last 2-3 years of canopy level variables that would be a good test.

Also useful to have fsmc as an output.

Thanks,  
Tristan.

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [29 September 2022 13:30 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/11 "2022-09-29T13:30:57Z")

</div>

Thanks, Tristan:  
That sounds possible and do-able, but it might take a little while.  
Do you have some other code that you’ve used before with your JULES5.0 SIF code that could be used to do a quicker check?  
Patrick

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [13 October 2022 09:55 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/12 "2022-10-13T09:55:37Z")

</div>

Hi Tristan:  
Any news on this?  
Patrick

---

<div class="post-metadata">

**Author:** ![tquaife](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tquaife](https://cms-helpdesk.ncas.ac.uk/u/tquaife)\
**Post date:** [21 October 2022 09:39 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/13 "2022-10-21T09:39:25Z")

</div>

Hi Patrick,

Sorry for the slow reply. You could take a look here:

/gws/nopw/j04/odanceo/tquaife/jules\_sif/global

That has a set of JULES nmls I previously ran to use this.

However, I think my preference would be if we could run a standard configuration for this work. What I did in that directory was very hacked together.

Thanks,  
Tristan.

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [21 October 2022 10:35 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/14 "2022-10-21T10:35:46Z")

</div>

Hi Tristan:  
This is excellent! It will make it a lot easier to do a quicker check of whether the FORTRAN code for JULES SIF is working. I will aim to do this first, and then the global runs that you want, after this is working.  
Patrick

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [25 October 2022 19:33 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/15 "2022-10-25T19:33:56Z")

</div>

Hi Tristan:  
I was able to use your namelists to run my checked-in branch copy of your JULES5.0 SIF code!

The checked-in branch copy is in:  
[https://code.metoffice.gov.uk/svn/jules/main/branches/dev/patrickmcguire/vn5.0\_sif1](https://code.metoffice.gov.uk/svn/jules/main/branches/dev/patrickmcguire/vn5.0_sif1)

I used the suite `~pmcguire/roses/u-al752currentworking11/` to compile this branch.  
And I did a test run with your namelists by:

```auto
cd /gws/nopw/j04/odanceo/pmcguire/jules_sif/global
./load_modules_and_run.sh > run2.log 2> run2.err &

```

The driving data for January 1979 is missing for some reason, so I started the run instead in February 1979. It produces spinup output.

I will next work on compiling my JULES7.0 SIF branch.  
Patrick

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/cms_support/original/1X/1fd2411499ffcbc299fe756cd5cdf26e44956558.png) [@system](https://cms-helpdesk.ncas.ac.uk/u/system)\
**Post date:** [24 November 2022 19:34 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/16 "2022-11-24T19:34:44Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [6 February 2023 22:59 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/17 "2023-02-06T22:59:12Z")

</div>



---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [6 February 2023 23:18 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/18 "2023-02-06T23:18:34Z")

</div>

Hi Tristan:  
I was able to get rid of a few bugs in my JULES7.0 solar-induced fluorescence (SIF) code!  
This ports your SIF-related changes of JULES5.0 from JULES5.0 to JULES7.0.  
I also manually updated the JULES5.0 SIF namelists to work with the JULES7.0 FORTRAN code.

The checked-in branch copy is in:  
[https://code.metoffice.gov.uk/svn/jules/main/branches/dev/patrickmcguire/vn7.0\_sif1](https://code.metoffice.gov.uk/svn/jules/main/branches/dev/patrickmcguire/vn7.0_sif1)

I used the suite `~pmcguire/roses/u-al752currentworking11_v7/` to compile this branch.  
And I did a test run with the updated namelists by:

```auto
cd /gws/nopw/j04/odanceo/pmcguire/jules_sif/global_v7
./load_modules_and_run_v7.sh > run_v7c.log 2> run_v7c.err &

```

As when running this with your JULES5.0 SIF branch, the driving data for January 1979 is missing for some reason, so I started the run instead in February 1979. It produces spinup output.

Among the next steps is to verify that the output makes sense.

Patrick

---

<div class="post-metadata">

**Author:** ![tquaife](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tquaife](https://cms-helpdesk.ncas.ac.uk/u/tquaife)\
**Post date:** [8 February 2023 09:14 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/19 "2023-02-08T09:14:51Z")

</div>

Thanks Patrick. Can you remind me what variables you have coming out on a per-canopy-layer basis?

Also I wonder if we should maybe not call this the “SIF” version (which I am aware was my idea). Maybe “layered canopy outputs” would be more accurate. Ultimately we will use this to calculate SIF offline rather than inside the model itself. It would be great to do the latter, but might take a lot more work.

---

<div class="post-metadata">

**Author:** ![pmcguire](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@pmcguire](https://cms-helpdesk.ncas.ac.uk/u/pmcguire)\
**Post date:** [8 February 2023 13:21 UTC](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728/20 "2023-02-08T13:21:46Z")

</div>

Hi Tristan:  
From the namelist file:  
`/gws/nopw/j04/odanceo/pmcguire/jules_sif/global_v7/output.nml`

these are the variables (the layered ones have the `'_lyr'` suffix):

```auto
profile_name='sif_vars',
var='gpp', 'gpp_lyr', 'apar_lyr', 'cmpf_lyr', 'lai', 'frac'

```

Patrick

[Next page](https://cms-helpdesk.ncas.ac.uk/t/get-sif-canopy-layer-code-into-jules-trunk/728.md?page=2)
