|
各位大神,您们好!
在下有一个关于non-keyword arguments are invalid after keyword arguments have been encountered的报错问题需要你们的帮助。
我在编译一个模式时,其中主程序有一段代码是这样的:
[Fortran] 纯文本查看 复制代码 type (rttov_emis_atlas_data) :: atlas ! 这个派生结构体已经在前面定义好了
... ...
call rttov_setup_emis_atlas( &
errorstatus, & ! out
opts(inst), & ! in
grid%start_month, & ! in
atlas_type = 1, & ! in, new for RTTOV V12
atlas , & ! inout, new for RTTOV V12
atlas_id = rttov_emis_atlas_mw, & ! in, optional, new for RTTOV V12
path = trim(atlas_path))!, & ! in, optional
call rttov_get_emis( &
errorstatus, & ! out
opts(inst), & ! in
chanprof, & ! in
profiles, & ! in
coefs(inst), & ! in
atlas, & ! in, new for RTTOV V12
emissivity = emissivity(:)%emis_in) ! out
call rttov_deallocate_emis_atlas(atlas) ! for RTTOV V12
... ... 下面是相应的子程序rttov_setup_emis_atlas截取的部分:
[Fortran] 纯文本查看 复制代码 SUBROUTINE rttov_setup_emis_atlas( &
err, &! out
opts, &! in
imonth, &! in
atlas_type, &! in
atlas, &! inout
atlas_id, &! in, optional
path, &! in, optional
coefs, &! in, optional
ir_atlas_read_std, &! in, optional
ir_atlas_ang_corr, &! in, optional
year) ! in, optional
IMPLICIT NONE
INTEGER(KIND=jpim), INTENT(OUT) :: err
TYPE(rttov_options), INTENT(IN) :: opts
INTEGER(KIND=jpim), INTENT(IN) :: imonth
INTEGER(KIND=jpim), INTENT(IN) :: atlas_type
TYPE(rttov_emis_atlas_data), INTENT(INOUT) :: atlas
INTEGER(KIND=jpim), INTENT(IN), OPTIONAL :: atlas_id
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: path
TYPE(rttov_coefs), INTENT(IN), OPTIONAL :: coefs
LOGICAL(KIND=jplm), INTENT(IN), OPTIONAL :: ir_atlas_read_std
LOGICAL(KIND=jplm), INTENT(IN), OPTIONAL :: ir_atlas_ang_corr
INTEGER(KIND=jpim), INTENT(IN), OPTIONAL :: year
下面是子程序rttov_get_emis截取的部分:
[Fortran] 纯文本查看 复制代码 SUBROUTINE rttov_get_emis( &
err, &! out
opts, &! in
chanprof, &! in
profiles, &! in
coefs, &! in
atlas, &! in
emissivity, &! out
emis_std, &! out, optional (IR atlases, TELSEM2)
emis_cov, &! out, optional (TELSEM2)
emis_flag, &! out, optional (IR atlases)
resolution) ! in, optional (TELSEM2)
IMPLICIT NONE
INTEGER(KIND=jpim), INTENT(OUT) :: err
TYPE(rttov_options), INTENT(IN) :: opts
TYPE(rttov_chanprof), INTENT(IN) :: chanprof(:)
TYPE(rttov_profile), INTENT(IN) :: profiles(:)
TYPE(rttov_coefs), INTENT(IN) :: coefs
TYPE(rttov_emis_atlas_data), INTENT(IN) :: atlas
REAL(KIND=jprb), INTENT(OUT) :: emissivity(SIZE(chanprof))
REAL(KIND=jprb), INTENT(OUT), OPTIONAL :: emis_std(SIZE(chanprof))
! emis_cov dims are (nprofs, nchans, nchans) where nchans is the maximum # channels per profile
REAL(KIND=jprb), INTENT(OUT), OPTIONAL :: emis_cov(:,:,:)
INTEGER(KIND=jpim), INTENT(OUT), OPTIONAL :: emis_flag(SIZE(chanprof))
REAL(KIND=jprb), INTENT(IN), OPTIONAL :: resolution
下面是子程序rttov_deallocate_emis_atlas截取的部分:
[Fortran] 纯文本查看 复制代码 SUBROUTINE rttov_deallocate_emis_atlas(atlas)
IMPLICIT NONE
TYPE(rttov_emis_atlas_data), INTENT(INOUT) :: atlas
然后每次编译时,都会在主程序调用子程序rttov_setup_emis_atlas时报错:
non-keyword arguments are invalid after keyword arguments have been encountered [atlas]
而我把它改成:
atlas = atlas
时,它就不报错。
所以我的问题是,为什么同样在主程序中调用子程序都用到atlas,却只在调用rttov_setup_emis_atlas时报这种错误,而在调用rttov_get_emis和rttov_deallocate_emis_atlas时,写成atlas却不报错?
希望大神们能提供您的建议,谢谢大家~
|
|