Opened 7 years ago

Closed 6 years ago

#1261 closed task (fixed)

making variables available in a UKCA routine

Reported by: s1251469 Owned by: luke
Component: UM Model Keywords: ukca
Cc: Platform: ARCHER
UM Version: 7.3



I would like to get updraught mass flux and air density (and eventually, cloud ice content and cloud fraction) into ukca_light.F90.

I can see cloud_ice_content is read into ukca_main1-ukca_main1.F90 and I think I could probably pass that down to the desired routine. However, I don't know what the other variables are called and how to read them.

Kind regards,

Change History (6)

comment:1 Changed 7 years ago by luke

  • Owner changed from um_support to luke
  • Status changed from new to accepted

Dear Declan,

To do this you will need to put the appropriate code in ukca_setd1defs.F90 and ukca_main1-ukca_main1.F90 (specificially the GETD1FLDS subroutine, as well as defining arrays for them) and then edit the UKCA STASH macro (which is one of your hand-edits at vn7.3) so that UKCA has knowledge of the fields.

If you look through ukca_setd1defs and GETD1FLDS and see how it is done for cloud_ice_content and then essentially copy that for the relevant STASH fields you require. You should also remember to increment the n_in_diags<SECTION> integer to the new correct total, including these fields.

Have a look and then get back to me if you are unsure about anything. I haven't included anything like this in the tutorial as it is quite high-level, but perhaps one should be added.


comment:2 Changed 7 years ago by s1251469

Thanks Luke,

Can I just check that you got my email about porting Alex's job? I realise I didn't give you much to go on with that so I will be patient. This ticket is just regarding work on the standard release that I already have working.

Regarding this ticket…
I think I've pretty much done the coding. Unfortunately there's a seg fault.

I've kept it simple and just tried to read in updraught mass flux (5250) and haven't carried it through to any subroutines yet.

The files I have made changes to are:
as well as switching path of the user handedit in job xjhxd.

Most of my code changes will have a comment with "dlf" in to make them easier to find.

The output is in ~s1251469/output/xjhxd000.xjhxd.d14080.t122840.leave

Do you know where that could be coming from? I changed n_in_diags5 value. And from the output ukca_main… seems to be getting info about 5250 from setd1defs. Not sure.

Many thanks,

comment:3 Changed 7 years ago by s1251469

I found the seg fault.

I managed to sneak a run on ARCHER with mass flux read into ukca_main1_ukca_main1.F90 successfully. Of course it might not have read in the variable correctly but I will hopefully find out soon.

I then tried to pass the variable down to ukca_light.F90 and assign one of it's levels to aflash so I could see in the output if the values were sensible.

That seems ok except the run fails from the following error

ERROR!!! in reconfiguration in routine HdAncilM
Error Code:- 20
Error Message:- Error opening ANCILmaster file, routine HDANCILM
Error generated from processor 0

I don't understand why the ANCILmaster would suddenly go wrong. I don't know where this is or how to check it. Do you know what might be up?

kind regards,

comment:4 follow-up: Changed 7 years ago by s1251469


I have made quite a bit of progress with this. Unfortunately my mass flux I've passed down into ukca_light seems a bit off. It is of the order 1018

The mass flux diagnostic output seems fine.

Perhaps you could check I have read it in correctly.
All code and STASH files are on PUMA in ~s1251469/coding_xjhx/lightning_grewe/

Some diagnostics are on ARCHER in ~s1251469/work/um/xjhxe/archive/xjhxea.phj0920
You will see that updraught mass flux at 5780m is order the order 10-1

I think that's fine. If you look at the total flashes diagnostic you will see what is probably the correct distribution but of 1093.

This is because the parameterisation is a power-5 relationship.

I also had the same 10E18 problem when I was reading air mass down from ukca_emission_ctl. You will see that on L169 of ukca_light_ctl I have now switched to using a different mass and this is reasonable. That says to me that it might be something to do with how I read stuff from ukca_main1_ukca_main1 → ukca_emission_ctl → ukca_light_ctl.

Also a .leave file: ~s1251469/output/xjhxe000.xjhxe.d14106.t132854.leave
search "dlfMESSAGE"
you'll see some output from ukca_light for a single level…
(air mass (kg) , mass flux (Pa s-1), mass flux (kg m-2 s-1) , height , air density (kg m-3) , cloudtop height , depth of cell , area of cell )

mflux - updraught mass flux (5250 I think)
mass/airmass - mass read down from ukca_emission_ctl but not currently being use because 10E18 problem
am_ij - calculated mass for (j,i)
mf_ij - mflux(j,i,:)

comment:5 in reply to: ↑ 4 Changed 7 years ago by s1251469

I have found my mistake. I had copied the initialisation code for mflux from an integer variable so it was just assigning random numbers. I am back on track now.

Thank you.

comment:6 Changed 6 years ago by ros

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.