sdat2 / seager19

Replication of Seager et al. (2019) Nat. Clim. Chan. They used a simple-as-possible coupled model to explain the bias in the nino3.4 trend in climate models (CMIP5). This repository replicates/reproduces their work, shows that it also applies to CMIP6, and varies some of the parameters.
https://seager19.readthedocs.io/
MIT License
6 stars 0 forks source link

Add docker image for circleci & for enabling cdf scripts. #16

Closed sdat2 closed 3 years ago

sdat2 commented 3 years ago

Tried, seemed very difficult to get to work. Look at the Dockerfile in the "before_spring_clean" branch for the attempt.

sdat2 commented 3 years ago

Basically killed my mac whilst docker was installed; it's very memory hungry (hard disk and ram).

sdat2 commented 3 years ago

13 shows that we need cdf, which is not available on Jasmin; so now I need to do this.

sdat2 commented 3 years ago

https://hub.docker.com/repository/docker/sdat2/seager19

sdat2 commented 3 years ago

When not enforcing gfortran version, compile gets error:

daio.c:142:24: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int’ [-Wformat=]
       fprintf (stderr, "wrda: addr=%ld error\n", *addr);
                        ^
gcc -Wno-implicit-function-declaration -Ofast -c sio.c
gfortran   -ffixed-line-length-132 -Ofast  -o tcom om_main.o wrap-mod.o data-mod.o sst-mod.o om_core.o om_ekm.o om_sst.o om_leap.o om_equi.o om_forc.o om_qflux.o om_tios.o om_mem.o om_wrap.o fodb.o  om_c.o codb.o daio.o sio.o -lnetcdf -lnetcdff
gcc -Wno-implicit-function-declaration -Ofast -o tios2cdf tios2cdf.c fodb.o om_c.o codb.o daio.o sio.o -lnetcdf -lnetcdff -lgfortran
tios2cdf.c: In function ‘write_stream’:
tios2cdf.c:569:25: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
           sprintf (buf, "T\0", pcnt);
                         ^
tios2cdf.c:569:25: warning: too many arguments for format [-Wformat-extra-args]
tios2cdf.c:591:23: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
         sprintf (buf, "T\0", pcnt);
                       ^
tios2cdf.c:591:23: warning: too many arguments for format [-Wformat-extra-args]
tios2cdf.c: In function ‘do_stream’:
tios2cdf.c:616:18: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
   sprintf(s_cnt, "%d\0", 100+cnt);
                  ^
tios2cdf.c: In function ‘do_grids’:
tios2cdf.c:642:21: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
       sprintf (buf, "X\0", cnt);
                     ^
tios2cdf.c:642:21: warning: too many arguments for format [-Wformat-extra-args]
tios2cdf.c:644:21: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
       sprintf (buf, "X_%s\0", cnt);
                     ^
tios2cdf.c:648:21: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
       sprintf (buf, "Y\0", cnt);
                     ^
tios2cdf.c:648:21: warning: too many arguments for format [-Wformat-extra-args]
tios2cdf.c:650:21: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
       sprintf (buf, "Y_%s\0", cnt);
                     ^
tios2cdf.c:654:21: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
       sprintf (buf, "L\0", cnt);
                     ^
tios2cdf.c:654:21: warning: too many arguments for format [-Wformat-extra-args]
tios2cdf.c:657:21: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
       sprintf (buf, "L_%s\0", cnt);
                     ^
tios2cdf.c:662:21: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
       sprintf (buf, "T\0", cnt);
                     ^
tios2cdf.c:662:21: warning: too many arguments for format [-Wformat-extra-args]
tios2cdf.c:664:21: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
       sprintf (buf, "T_%s\0", cnt);
                     ^
tios2cdf.c: In function ‘def_var’:
tios2cdf.c:715:53: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
        for (i = 0; i < ndim; i++) sprintf (idim[i], "%c\0", xyz[i]);
                                                     ^
tios2cdf.c:717:53: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
        for (i = 0; i < ndim; i++) sprintf (idim[i], "%c_%s\0", xyz[i], cnt);
                                                     ^
tios2cdf.c: In function ‘lread_tios’:
tios2cdf.c:142:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread (tios.tios_name, (size_t)1, (size_t)TITLE_TIOS_LEN, file);
   ^
tios2cdf.c: In function ‘lread_var’:
tios2cdf.c:256:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread (label, (size_t)1, (size_t)STR_VAR_LEN, indx_file);
   ^
tios2cdf.c: In function ‘lread_stream’:
tios2cdf.c:312:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread (str_curr->label, (size_t)1, (size_t)LABEL_STREAM_LEN, indx_file);

GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609

sdat2 commented 3 years ago

x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c wrap-mod.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c data-mod.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c sst-mod.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_core.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_ekm.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_sst.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_leap.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_equi.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_forc.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_qflux.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_tios.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_mem.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_wrap.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c fodb.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_main.F x86_64-linux-gnu-gcc-4.8 -Wno-implicit-function-declaration -Ofast -c om_c.c x86_64-linux-gnu-gcc-4.8 -Wno-implicit-function-declaration -Ofast -c codb.c x8664-linux-gnu-gcc-4.8 -Wno-implicit-function-declaration -Ofast -c daio.c daio.c: In function ‘wrda’: daio.c:142:7: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int’ [-Wformat=] fprintf (stderr, "wrda: addr=%ld error\n", addr); ^ x86_64-linux-gnu-gcc-4.8 -Wno-implicit-function-declaration -Ofast -c sio.c x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -o tcom om_main.o wrap-mod.o data-mod.o sst-mod.o om_core.o om_ekm.o om_sst.o om_leap.o om_equi.o om_forc.o om_qflux.o om_tios.o om_mem.o om_wrap.o fodb.o om_c.o codb.o daio.o sio.o -lnetcdf -lnetcdff x86_64-linux-gnu-gcc-4.8 -Wno-implicit-function-declaration -Ofast -o tios2cdf tios2cdf.c fodb.o om_c.o codb.o daio.o sio.o -lnetcdf -lnetcdff -lgfortran tios2cdf.c: In function ‘write_stream’: tios2cdf.c:569:11: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "T\0", pcnt); ^ tios2cdf.c:569:11: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c:591:9: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "T\0", pcnt); ^ tios2cdf.c:591:9: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c: In function ‘do_stream’: tios2cdf.c:616:3: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf(s_cnt, "%d\0", 100+cnt); ^ tios2cdf.c: In function ‘dogrids’: tios2cdf.c:642:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "X\0", cnt); ^ tios2cdf.c:642:7: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c:644:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "X%s\0", cnt); ^ tios2cdf.c:648:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "Y\0", cnt); ^ tios2cdf.c:648:7: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c:650:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "Y%s\0", cnt); ^ tios2cdf.c:654:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "L\0", cnt); ^ tios2cdf.c:654:7: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c:657:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "L%s\0", cnt); ^ tios2cdf.c:662:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "T\0", cnt); ^ tios2cdf.c:662:7: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c:664:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "T_%s\0", cnt); ^ tios2cdf.c: In function ‘defvar’: tios2cdf.c:715:8: warning: embedded ‘\0’ in format [-Wformat-contains-nul] for (i = 0; i < ndim; i++) sprintf (idim[i], "%c\0", xyz[i]); ^ tios2cdf.c:717:8: warning: embedded ‘\0’ in format [-Wformat-contains-nul] for (i = 0; i < ndim; i++) sprintf (idim[i], "%c%s\0", xyz[i], cnt); ^ tios2cdf.c: In function ‘lread_tios’: tios2cdf.c:142:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread (tios.tios_name, (size_t)1, (size_t)TITLE_TIOS_LEN, file); ^ tios2cdf.c: In function ‘lread_var’: tios2cdf.c:256:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread (label, (size_t)1, (size_t)STR_VAR_LEN, indx_file); ^ tios2cdf.c: In function ‘lread_stream’: tios2cdf.c:312:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread (str_curr->label, (size_t)1, (size_t)LABEL_STREAM_LEN, indx_file); ^ (/home/users/sithom/seager19/env) Singularity> make all make: Nothing to be done for 'all'. (/home/users/sithom/seager19/env) Singularity> cd .. (/home/users/sithom/seager19/env) Singularity> sh move-object-files.sh (/home/users/sithom/seager19/env) Singularity> cd SRC (/home/users/sithom/seager19/env) Singularity> make all x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c wrap-mod.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c data-mod.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c sst-mod.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_core.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_ekm.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_sst.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_leap.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_equi.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_forc.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_qflux.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_tios.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_mem.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_wrap.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c fodb.F x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -c om_main.F x86_64-linux-gnu-gcc-4.8 -Wno-implicit-function-declaration -Ofast -c om_c.c x86_64-linux-gnu-gcc-4.8 -Wno-implicit-function-declaration -Ofast -c codb.c x8664-linux-gnu-gcc-4.8 -Wno-implicit-function-declaration -Ofast -c daio.c daio.c: In function ‘wrda’: daio.c:142:7: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int’ [-Wformat=] fprintf (stderr, "wrda: addr=%ld error\n", addr); ^ x86_64-linux-gnu-gcc-4.8 -Wno-implicit-function-declaration -Ofast -c sio.c x86_64-linux-gnu-gfortran-4.8 -ffixed-line-length-132 -Ofast -o tcom om_main.o wrap-mod.o data-mod.o sst-mod.o om_core.o om_ekm.o om_sst.o om_leap.o om_equi.o om_forc.o om_qflux.o om_tios.o om_mem.o om_wrap.o fodb.o om_c.o codb.o daio.o sio.o -lnetcdf -lnetcdff x86_64-linux-gnu-gcc-4.8 -Wno-implicit-function-declaration -Ofast -o tios2cdf tios2cdf.c fodb.o om_c.o codb.o daio.o sio.o -lnetcdf -lnetcdff -lgfortran tios2cdf.c: In function ‘write_stream’: tios2cdf.c:569:11: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "T\0", pcnt); ^ tios2cdf.c:569:11: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c:591:9: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "T\0", pcnt); ^ tios2cdf.c:591:9: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c: In function ‘do_stream’: tios2cdf.c:616:3: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf(s_cnt, "%d\0", 100+cnt); ^ tios2cdf.c: In function ‘dogrids’: tios2cdf.c:642:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "X\0", cnt); ^ tios2cdf.c:642:7: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c:644:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "X%s\0", cnt); ^ tios2cdf.c:648:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "Y\0", cnt); ^ tios2cdf.c:648:7: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c:650:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "Y%s\0", cnt); ^ tios2cdf.c:654:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "L\0", cnt); ^ tios2cdf.c:654:7: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c:657:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "L%s\0", cnt); ^ tios2cdf.c:662:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "T\0", cnt); ^ tios2cdf.c:662:7: warning: too many arguments for format [-Wformat-extra-args] tios2cdf.c:664:7: warning: embedded ‘\0’ in format [-Wformat-contains-nul] sprintf (buf, "T_%s\0", cnt); ^ tios2cdf.c: In function ‘defvar’: tios2cdf.c:715:8: warning: embedded ‘\0’ in format [-Wformat-contains-nul] for (i = 0; i < ndim; i++) sprintf (idim[i], "%c\0", xyz[i]); ^ tios2cdf.c:717:8: warning: embedded ‘\0’ in format [-Wformat-contains-nul] for (i = 0; i < ndim; i++) sprintf (idim[i], "%c%s\0", xyz[i], cnt); ^ tios2cdf.c: In function ‘lread_tios’: tios2cdf.c:142:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread (tios.tios_name, (size_t)1, (size_t)TITLE_TIOS_LEN, file); ^ tios2cdf.c: In function ‘lread_var’: tios2cdf.c:256:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread (label, (size_t)1, (size_t)STR_VAR_LEN, indx_file); ^ tios2cdf.c: In function ‘lread_stream’: tios2cdf.c:312:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread (str_curr->label, (size_t)1, (size_t)LABEL_STREAM_LEN, indx_file); ^