关于发展模式加入变量的问题解决

发布时间:2024年01月01日

问题1描述:

编译的时候不报错,但是在运行的时候出错输出

FLDLST: ustar in fincl( 17 ) not found

ENDRUN: called without a message string

问题1解决:

这是因为在cas-esm 的atm_in 中写入了某个变量,但是在F90 代码里面没有加入场变量。

这是因为没有addfld(),尝试在init 的时候加入场变量来解决问题,或者在atm_in的fincl中删除这个变量。

call addfld( 'ustar'       , 'm/s'      , 1      , 'A', 'ustar'                              , phys_decomp )!mayubin 2023-12-20

问题2描述:

最近遇到一个奇怪的问题,当我输出ustar和obklen的时候,在运行的时候居然一只卡在了输出文件上很奇怪啊

然后我打开casesm.o10997620文件查看我的出错信息

 
 

(base) [chengxl@login03 run]$ cat casesm.e10997620

srun: ROUTE: split_hostlist: hl=e2112r7n[2-4],e2113r1n[1-4],e2113r2n[1-4],e2113r3n[1-4],e2113r4n[1-4],e2113r5n[1-4],

e2113r6n[1-4],e2113r7n[1-4],e2201r1n1 tree_width 0

slurmstepd: error: *** STEP 10997620.0 ON e2112r7n2 CANCELLED AT 2023-12-26T23:21:33 ***

srun: Job step aborted: Waiting up to 32 seconds for job step to finish.

slurmstepd: error: *** JOB 10997620 ON e2112r7n2 CANCELLED AT 2023-12-26T23:21:33 ***

forrtl: error (78): process killed (SIGTERM)

Image PC Routine Line Source

casesm.exe 0000000001682A6A Unknown Unknown Unknown

libpthread-2.17.s 00002B8F83C075D0 Unknown Unknown Unknown

libpthread-2.17.s 00002B8F83C044A3 pthread_spin_lock Unknown Unknown

解决2方法:

由于将原来的atm_in 和drv_in复制进现在的运行目录导致的。

问题2解决探索过程:

这个我还没有找到解决办法,也不知道问题是怎么出现的。

我试图减少我自己输出变量的个数

当我减少了我的输出变量之后,确实问题消失了,这就说明可能是我剩下的注释掉的变量的输出可能存在问题。

 nhtfrq = 0, 0 ! , -1 , 1     ! ,-1     ,-24    ,0     ,-2190  , -8760 
 mfilt  = 1, 1 ! , 24 , 26280 ! ,8760   ,365    ,12    , 4     ,1     

fincl1 = 'lhf_tbf','tau_tbf' ,'shf_tbf','n2','pbl_h','h_wave','ri','tau_coare','hsb_coare','hlb_coare', 'LHFLX', 'SHFLX'

fincl2 = 'QREFHT', 'TREFHTMN', 'TREFHTMX', 'TREFHT', 'PRECT', 'RHREFHT', 'PS', 'PSL', 'U10', 'CLDTOT', 'PRECC', 'PRECSC', 'PRECSL', 'LHFLX', 'SHFLX', 'FLDS', 'FLUT', 'FSDS', 'FSUTOA', 'FLUTC', 'TS', 'T', 'Q', 'RELHUM', 'OMEGA', 'U', 'V', 'Z3', 'FLNS','ri','n2','pbl_h','h_wave',

接下来要进一步排查问题。

插入:我们可以看见,在atm_in中加入要输出的变量,但是实际上在fortran中没有写outfld语句的时候,是不会报错的。只会 全部输出为0。

接下来我们试验加入变量h_wave_ln,结果发现,这个变量加入就导致了在变量输出的时候卡住了。

接下来我去掉h_wave_ln .然后加入qsss,tau_coare,hsb_coare,hlb_coare ,pbl_h 再次运行试验,不存在输出问题。

接下来,我们加入,ri , n2 , ustar 和obklen 再尝试一下

在运行的时候出现了这个

FLDLST: ustar in fincl( 16 ) not found

ENDRUN: called without a message string

?我在init的时候加上addfld再尝试

 
 

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(802): error #6410: This name has not bee

n declared as an array or a function. [IFRAC]

ifrac(i,j) = x2o_o%rAttr(index_x2o_Si_ifrac,n) ! ice fraction

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(803): error #6410: This name has not bee

n declared as an array or a function. [PATM]

patm (i,j) = x2o_o%rAttr(index_x2o_Sa_pslv,n) ! sea level pressure index_x2o_Sa_pslv

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(805): error #6410: This name has not bee

n declared as an array or a function. [TAUX]

taux (i,j) = x2o_o%rAttr(index_x2o_Foxx_taux,n) ! surface stress, zonal

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(806): error #6410: This name has not bee

n declared as an array or a function. [TAUY]

tauy (i,j) = x2o_o%rAttr(index_x2o_Foxx_tauy,n) ! surface stress, merid

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(807): error #6410: This name has not bee

n declared as an array or a function. [NETSW]

netsw(i,j) = x2o_o%rAttr(index_x2o_Foxx_swnet,n) ! net sw rad

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(808): error #6410: This name has not bee

n declared as an array or a function. [SEN]

sen (i,j) = x2o_o%rAttr(index_x2o_Foxx_sen,n) ! sensible

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(809): error #6410: This name has not bee

n declared as an array or a function. [LWUP]

lwup (i,j) = x2o_o%rAttr(index_x2o_Foxx_lwup,n) ! long-wave up

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(810): error #6410: This name has not bee

n declared as an array or a function. [LWDN]

lwdn (i,j) = x2o_o%rAttr(index_x2o_Foxx_lwdn,n) ! long-wave down

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(811): error #6410: This name has not bee

n declared as an array or a function. [MELTH]

melth(i,j) = x2o_o%rAttr(index_x2o_Foxx_melth,n) ! melt heat

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(812): error #6410: This name has not bee

n declared as an array or a function. [SALT]

salt (i,j) = x2o_o%rAttr(index_x2o_Foxx_salt,n) ! salinity flux

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(813): error #6410: This name has not bee

n declared as an array or a function. [PREC]

prec (i,j) = x2o_o%rAttr(index_x2o_Foxx_prec,n) !index_x2o_Foxx_prec

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(814): error #6410: This name has not bee

n declared as an array or a function. [EVAP]

evap (i,j) = x2o_o%rAttr(index_x2o_Foxx_evap,n) ! evaporation

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(815): error #6410: This name has not bee

n declared as an array or a function. [MELTW]

meltw(i,j) = x2o_o%rAttr(index_x2o_Foxx_meltw,n) ! melt water

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(816): error #6410: This name has not bee

n declared as an array or a function. [ROFF]

roff (i,j) = x2o_o%rAttr(index_x2o_Forr_roff,n) ! runoff !LPF 20121219

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(817): error #6410: This name has not bee

n declared as an array or a function. [DUU10N]

duu10n(i,j) = x2o_o%rAttr(index_x2o_So_duu10n,n) ! 10m wind speed squared

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(819): error #6410: This name has not bee

n declared as an array or a function. [SNOW1]

snow1(i,j) = x2o_o%rAttr(index_x2o_Foxx_snow,n) !snow flux

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(820): error #6410: This name has not bee

n declared as an array or a function. [ICEOFF]

iceoff(i,j)= x2o_o%rAttr(index_x2o_Forr_ioff,n) !ice runoff

-----------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(837): error #6404: This name does not ha

ve a type, and must have an explicit type. [LAT1]

lat1= LATVAP*evap ! latent (derive from evap)

--------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(837): error #8497: Illegal use of a proc

edure name in an expression, possibly a function call missing parenthesis. [EVAP]

lat1= LATVAP*evap ! latent (derive from evap)

---------------------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(839): error #6087: An array assignment s

tatement is required in this context. [PATM]

where(vit(:,:,1)

------------------------------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(840): error #6087: An array assignment s

tatement is required in this context. [IFRAC]

where(vit(:,:,1)

------------------------------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(841): error #6087: An array assignment s

tatement is required in this context. [TAUX]

where(vit(:,:,1)

------------------------------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(842): error #6087: An array assignment s

tatement is required in this context. [TAUY]

where(vit(:,:,1)

------------------------------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(843): error #6087: An array assignment s

tatement is required in this context. [NETSW]

where(vit(:,:,1)

------------------------------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(844): error #6087: An array assignment s

tatement is required in this context. [SEN]

where(vit(:,:,1)

------------------------------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(845): error #6087: An array assignment s

tatement is required in this context. [LWUP]

where(vit(:,:,1)

------------------------------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(846): error #6087: An array assignment s

tatement is required in this context. [LWDN]

where(vit(:,:,1)

------------------------------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(847): error #6087: An array assignment s

tatement is required in this context. [MELTH]

where(vit(:,:,1)

------------------------------^

/data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90(848): error #6087: An array assignment s

tatement is required in this context. [SALT]

where(vit(:,:,1)

------------------------------^

/tmp/ifortws2x0W.i90(2855): catastrophic error: Too many errors, exiting

compilation aborted for /data/chengxl/CAS-ESM2.0-test1/run/HIST_var_list_2/ocn/source/licomcpl7.F90 (code 1)

gmake: *** [licomcpl7.o] Error 1

gmake: *** Waiting for unfinished jobs....

?突然在编译的时候出现了licom 的一堆问题,很奇怪,之前也遇到过这样的问题。或许这只是偶然的现象。再次编译,这个问题消失。

运行后出现,

=====================================================================

Opened file B20TR_C35_y100.iap.h1.2000-01.nc to write 1638400

pio_support::pio_die:: myrank= -1 : ERROR:

pionfwrite_mod::write_nfdarray_double: 217 :

N

etCDF: Numeric conversion not representable

NETCDF:数值转换无法表示,这可能是存在什么变量类型转变问题。检查一下ustar,obklen,h_wave_ln的计算代码

会不会是因为这个,
————————————————
原文链接:https://blog.csdn.net/weixin_38594380/article/details/108335540

所以我改成D试一下,因为其他都是双精度的。

另外,sign是什么函数?

取前面数的绝对值,取后面数的符号。
例如:
c = SIGN (5.2, -3.1) ! returns -5.2
c = SIGN (-5.2, -3.1) ! returns -5.2
c = SIGN (-5.2, 3.1) ! returns 5.2

?将E改成D之后在进行实验

还是不对,不知道哪里出问题了。

删去输出ustar和obklen的代码,然后就不会出现在输出中断的问题。

现在发现在atm_in加上ustar和obklen都不行,会导致中断

现在发现这些还不是问题,可能原因是:我直接把原来的atm_in,drv_in复制过来导致的问题。

我后来终于发现,导致这种情况的原因就是:我把atm_in,drv_in 复制到当前运行文件夹下导致的问题。

?但是我又得将我新加的变量放里面输出,所以我使用sed命令在当前生成的atm_in里加入新输出的变量配置语句。

sed -i "12 a\\nhtfrq=0,0" atm_in
sed -i "13 a\\fincl1 = 'lhf_tbf','tau_tbf' ,'shf_tbf','n2','pbl_h','h_wave','tau_coare','hsb_coare','hlb_coare', 'LHFLX', 'SHFLX','qsss'" atm_in
sed -i "14 a\\fincl2 =  'U10','LHFLX', 'SHFLX', 'TS', 'T', 'Q', 'RELHUM', 'OMEGA', 'U', 'V', 'Z3','ri','n2','pbl_h','h_wave','obklen','ustar','h_wave_ln' "  atm_in

这里面:

sed -i "12 a\\nhtfrq=0,0" atm_in

12 表示在第十二行,

\\后加入想要加入语句

atm_in 表示想要操作的文件

总结一下:

sed -i "行号 a\\加入的命令" 文件名.后缀

文章来源:https://blog.csdn.net/mayubins/article/details/135097740
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。